예제 #1
0
 public function testIgnorePatterns()
 {
     $fixture_data = '*/test/*';
     $fixture_data2 = '*/test?/*';
     $result_data = '.*\\/test\\/.*';
     $result_data2 = '.*\\/test.\\/.*';
     // default is empty
     $this->assertEquals(array(), $this->fixture->getIgnorePatterns());
     // test adding a normal glob with asterisks on both sides
     $this->fixture->addIgnorePattern($fixture_data);
     $this->assertEquals(array($result_data), $this->fixture->getIgnorePatterns());
     // what happens if we add another one with a question mark?
     $this->fixture->addIgnorePattern($fixture_data2);
     $this->assertEquals(array($result_data, $result_data2), $this->fixture->getIgnorePatterns());
     // what happens if we set all to an empty array
     $this->fixture->setIgnorePatterns(array());
     $this->assertEquals(array(), $this->fixture->getIgnorePatterns());
     // what happens if we set both patterns using the setIgnorePatterns method
     $this->fixture->setIgnorePatterns(array($fixture_data, $fixture_data2));
     $this->assertEquals(array($result_data, $result_data2), $this->fixture->getIgnorePatterns());
 }