class FilterCollectionTest

Hierarchy

  • class \Assetic\Test\Filter\FilterCollectionTest extends \Assetic\Test\Filter\PHPUnit_Framework_TestCase

Expanded class hierarchy of FilterCollectionTest

File

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

Namespace

Assetic\Test\Filter
View source
class FilterCollectionTest extends \PHPUnit_Framework_TestCase {
  public function testInterface() {
    $filter = new FilterCollection();
    $this
      ->assertInstanceOf('Assetic\\Filter\\FilterInterface', $filter, 'FilterCollection implements FilterInterface');
  }
  public function testEnsure() {
    $filter = $this
      ->getMock('Assetic\\Filter\\FilterInterface');
    $asset = $this
      ->getMock('Assetic\\Asset\\AssetInterface');
    $filter
      ->expects($this
      ->once())
      ->method('filterLoad');
    $coll = new FilterCollection();
    $coll
      ->ensure($filter);
    $coll
      ->ensure($filter);
    $coll
      ->filterLoad($asset);
  }
  public function testAll() {
    $filter = new FilterCollection(array(
      $this
        ->getMock('Assetic\\Filter\\FilterInterface'),
      $this
        ->getMock('Assetic\\Filter\\FilterInterface'),
    ));
    $this
      ->assertInternalType('array', $filter
      ->all(), '->all() returns an array');
  }
  public function testEmptyAll() {
    $filter = new FilterCollection();
    $this
      ->assertInternalType('array', $filter
      ->all(), '->all() returns an array');
  }
  public function testCountable() {
    $filters = new FilterCollection(array(
      $this
        ->getMock('Assetic\\Filter\\FilterInterface'),
    ));
    $this
      ->assertEquals(1, count($filters), 'Countable returns the count');
  }

}

Members