class FilterManagerTest

Hierarchy

  • class \Assetic\Test\FilterManagerTest extends \Assetic\Test\PHPUnit_Framework_TestCase

Expanded class hierarchy of FilterManagerTest

File

drupal/core/vendor/kriswallsmith/assetic/tests/Assetic/Test/FilterManagerTest.php, line 16

Namespace

Assetic\Test
View source
class FilterManagerTest extends \PHPUnit_Framework_TestCase {
  private $fm;
  protected function setUp() {
    $this->fm = new FilterManager();
  }
  public function testInvalidName() {
    $this
      ->setExpectedException('InvalidArgumentException');
    $this->fm
      ->get('foo');
  }
  public function testGetFilter() {
    $filter = $this
      ->getMock('Assetic\\Filter\\FilterInterface');
    $name = 'foo';
    $this->fm
      ->set($name, $filter);
    $this
      ->assertSame($filter, $this->fm
      ->get($name), '->set() sets a filter');
  }
  public function testHas() {
    $this->fm
      ->set('foo', $this
      ->getMock('Assetic\\Filter\\FilterInterface'));
    $this
      ->assertTrue($this->fm
      ->has('foo'), '->has() returns true if the filter is set');
  }
  public function testHasInvalid() {
    $this
      ->assertFalse($this->fm
      ->has('foo'), '->has() returns false if the filter is not set');
  }
  public function testInvalidAlias() {
    $this
      ->setExpectedException('InvalidArgumentException');
    $this->fm
      ->set('@foo', $this
      ->getMock('Assetic\\Filter\\FilterInterface'));
  }

}

Members