function testOnlyMatchedFilesAreAddedToGroup() { $suite = new MockTestSuite(); $suite->expectOnce('addTestFile', array(new PathEqualExpectation(dirname(__FILE__) . '/support/collector/collectable.1'))); $collector = new SimplePatternCollector('/1$/'); $collector->collect($suite, dirname(__FILE__) . '/support/collector/'); }
function it_should_add_succeed_result_if_test_has_no_failed_results(MockTestSuite $suite) { // not processing for class::method $suite->getName()->willReturn('SomeClass::Foo'); $this->endTestSuite($suite); $this->getResults()->shouldHaveCount(0); // not processing for unexistent class $suite->getName()->willReturn('SomeClass'); $this->endTestSuite($suite); $this->getResults()->shouldHaveCount(0); $suite->getName()->willReturn(__CLASS__); $this->shouldNotBeFailed(); $this->endTestSuite($suite); $result = $this->getResults(); $result = $result[0]; $result->shouldBeSucceed(); }
function it_should_save_coverage_session(MockTestSuite $suite, \PHPUnit_TextUI_ResultPrinter $printer) { $suite->run(Argument::any())->shouldBeCalled()->willReturn(null); $suite->setRunTestInSeparateProcess(Argument::any())->shouldBeCalled(); $this->doRun($suite, array('printer' => $printer)); }