Ejemplo n.º 1
0
 function testCollectionIsAddedToGroup()
 {
     $group = new MockGroupTest();
     $group->expectMinimumCallCount('addTestFile', 2);
     $group->expectArguments('addTestFile', array(new PatternExpectation('/collectable\\.(1|2)$/')));
     $collector = new SimpleCollector();
     $collector->collect($group, dirname(__FILE__) . '/support/collector/');
 }
Ejemplo n.º 2
0
 function testCollectionIsAddedToGroup()
 {
     $suite = new MockTestSuite();
     $suite->expectMinimumCallCount('addFile', 2);
     $suite->expect('addFile', array(new PatternExpectation('/collectable\\.(1|2)$/')));
     $collector = new SimpleCollector();
     $collector->collect($suite, dirname(__FILE__) . '/support/collector/');
 }
Ejemplo n.º 3
0
 protected function isHidden($filename)
 {
     // ignore base.php: with abstract test case class (throws Bad TestSuite [No runnable test cases] otherwise)
     if ($filename == "base.php" || $filename == "index.php") {
         return true;
     }
     return parent::isHidden($filename);
 }
Ejemplo n.º 4
0
 /**
  *    Delegates to a visiting collector to add test
  *    files.
  *    @param string $path                  Path to scan from.
  *    @param SimpleCollector $collector    Directory scanner.
  *    @access public
  */
 function collect($path, &$collector) {
     $collector->collect($this, $path);
 }
Ejemplo n.º 5
0
 /**
  *    Delegates to a visiting collector to add test
  *    files.
  * @param string $path Path to scan from.
  * @param SimpleCollector $collector Directory scanner.
  */
 public function collect($path, $collector)
 {
     $collector->collect($this, $path);
 }
Ejemplo n.º 6
0
 /**
  * Attempts to add files that match a given pattern.
  *
  * @see SimpleCollector::_handle()
  * @param object $test    Group test with {@link GroupTest::addTestFile()} method.
  * @param string $path    Directory to scan.
  * @access protected
  */
 protected function handle(&$test, $filename)
 {
     if (preg_match($this->pattern, $filename)) {
         parent::handle($test, $filename);
     }
 }
Ejemplo n.º 7
0
 /**
  * Attempts to add files that match a given pattern.
  *
  * @see SimpleCollector::_handle()
  * @param object $test    Group test with {@link GroupTest::addTestFile()} method.
  * @param string $path    Directory to scan.
  * @access protected
  */
 function _handle(&$test, $filename)
 {
     if (preg_match($this->_pattern, $filename)) {
         parent::_handle($test, $filename);
     }
 }