Exemple #1
0
 /**
  * @testdox Setting $tag->attributePreprocessors clears previous attributePreprocessors
  * @depends testAttributePreprocessorsArray
  */
 public function testAttributePreprocessorsArrayClears()
 {
     $attributePreprocessors = [['foo', '/a/'], ['foo', '/b/'], ['bar', '/c/']];
     $expected = new AttributePreprocessorCollection();
     $expected->add('foo', '/a/');
     $expected->add('foo', '/b/');
     $expected->add('bar', '/c/');
     $tag = new Tag();
     $tag->attributePreprocessors->add('baz', '/d/');
     $tag->attributePreprocessors = $attributePreprocessors;
     $this->assertEquals($expected->asConfig(), $tag->attributePreprocessors->asConfig());
 }
 /**
  * @testdox merge() throws an exception when passed a one-dimensional array
  * @expectedException InvalidArgumentException
  */
 public function testMergeInvalidArray()
 {
     $collection = new AttributePreprocessorCollection();
     $collection->merge(['/foo/']);
 }