public function testDataProvider() { $r = new HttpPHPUnit\ResultPrinter(); $t = new self('DataProvider', array(1, 2, '<b>3</b>')); $r->setAutoFlush(false); $r->dir = __DIR__; $r->addError($t, new Exception(), 0); $content = file_get_contents($this->readAttribute($r, 'file')); $this->assertContains('<a href="?test=/ResultPrinter_getTestInfo_Test.php::DataProvider+with+data+set+%22%22">ResultPrinter_getTestInfo :: DataProvider</a>', $content); }
public function testDataProviderOneLine() { $r = new HttpPHPUnit\ResultPrinter(); $t = new self('DataProvider', array(1, 2, '<b>3</b>')); $r->setAutoFlush(false); $r->addIncompleteTest($t, new Exception(), 0); $refl = new ReflectionMethod($r, 'endRun'); $refl->setAccessible(true); $refl->invoke($r); $content = file_get_contents($this->readAttribute($r, 'file')); $this->assertContains('</small><small><small> with data set "" (1, 2, \'<b>3</b>\')</small></small>', $content); }
public function testFailAndSkippedAndIncomplete() { $this->r->endTest($this->t, 0); $this->r->addFailure($this->t, new PHPUnit_Framework_AssertionFailedError(), 0); $this->r->addSkippedTest($this->t, new Exception(), 0); $this->r->addIncompleteTest($this->t, new Exception(), 0); $this->t('failure', '1 test failed! 1 test was incomplete. 1 test was skipped.'); }