How to use getTestPaths method of runner class

Best Atoum code snippet using runner.getTestPaths

runner.php

Source:runner.php Github

copy

Full Screen

...37 ->variable($runner->getRunningDuration())->isNull()38 ->boolean($runner->codeCoverageIsEnabled())->isTrue()39 ->variable($runner->getDefaultReportTitle())->isNull()40 ->array($runner->getObservers())->isEmpty()41 ->array($runner->getTestPaths())->isEmpty()42 ->variable($runner->getXdebugConfig())->isNull()43 ;44 }45 public function testSetTestPaths()46 {47 $this48 ->if($runner = new testedClass())49 ->then50 ->object($runner->setTestPaths($paths = [uniqid(), uniqid(), uniqid()]))->isIdenticalTo($runner)51 ->array($runner->getTestPaths())->isEqualTo($paths)52 ;53 }54 public function testResetTestPaths()55 {56 $this57 ->if($runner = new testedClass())58 ->and($runner->setTestPaths([uniqid(), uniqid(), uniqid()]))59 ->then60 ->object($runner->resetTestPaths())->isIdenticalTo($runner)61 ->array($runner->getTestPaths())->isEmpty()62 ;63 }64 public function testSetPhp()65 {66 $this67 ->if($runner = new testedClass())68 ->then69 ->object($runner->setPhp($php = new atoum\php()))->isIdenticalTo($runner)70 ->object($runner->getPhp())->isIdenticalTo($php)71 ->object($runner->setPhp())->isIdenticalTo($runner)72 ->object($runner->getPhp())73 ->isEqualTo(new atoum\php())74 ->isNotIdenticalTo($php)75 ;76 }77 public function testSetAdapter()78 {79 $this80 ->if($runner = new testedClass())81 ->then82 ->object($runner->setAdapter($adapter = new atoum\test\adapter()))->isIdenticalTo($runner)83 ->object($runner->getAdapter())->isIdenticalTo($adapter)84 ;85 }86 public function testSetScore()87 {88 $this89 ->if($runner = new testedClass())90 ->then91 ->object($runner->setScore($score = new atoum\runner\score()))->isIdenticalTo($runner)92 ->object($runner->getScore())->isIdenticalTo($score);93 ;94 }95 public function testSetDefaultReportTtitle()96 {97 $this98 ->if($runner = new testedClass())99 ->then100 ->object($runner->setDefaultReportTitle($title = uniqid()))->isIdenticalTo($runner)101 ->string($runner->getDefaultReportTitle())->isEqualTo($title)102 ;103 }104 public function testGetPhpPath()105 {106 $this107 ->if($runner = new testedClass())108 ->then109 ->string($runner->getPhpPath())->isEqualTo($runner->getPhp()->getBinaryPath())110 ;111 }112 public function testSetPhpPath()113 {114 $this115 ->if($runner = new testedClass())116 ->then117 ->object($runner->setPhpPath($phpPath = uniqid()))->isIdenticalTo($runner)118 ->string($runner->getPhpPath())->isIdenticalTo($phpPath)119 ;120 }121 public function testSetTestGenerator()122 {123 $this124 ->if($runner = new testedClass())125 ->then126 ->object($runner->setTestGenerator($generator = new test\generator()))->isIdenticalTo($runner)127 ->object($runner->getTestGenerator())->isIdenticalTo($generator)128 ->object($runner->setTestGenerator())->isIdenticalTo($runner)129 ->object($runner->getTestGenerator())130 ->isInstanceOf(atoum\test\generator::class)131 ->isNotIdenticalTo($generator)132 ;133 }134 public function testEnableDebugMode()135 {136 $this137 ->if($runner = new testedClass())138 ->then139 ->object($runner->enableDebugMode())->isIdenticalTo($runner)140 ->boolean($runner->debugModeIsEnabled())->isTrue()141 ->object($runner->enableDebugMode())->isIdenticalTo($runner)142 ->boolean($runner->debugModeIsEnabled())->isTrue()143 ;144 }145 public function testDisableDebugMode()146 {147 $this148 ->if($runner = new testedClass())149 ->then150 ->object($runner->disableDebugMode())->isIdenticalTo($runner)151 ->boolean($runner->debugModeIsEnabled())->isFalse()152 ->object($runner->disableDebugMode())->isIdenticalTo($runner)153 ->boolean($runner->debugModeIsEnabled())->isFalse()154 ->if($runner->enableDebugMode())155 ->then156 ->object($runner->disableDebugMode())->isIdenticalTo($runner)157 ->boolean($runner->debugModeIsEnabled())->isFalse()158 ;159 }160 public function testDisallowUsageOfUndefinedMethodInMock()161 {162 $this163 ->if($runner = new testedClass())164 ->then165 ->object($runner->disallowUsageOfUndefinedMethodInMock())->isIdenticalTo($runner)166 ->boolean($runner->usageOfUndefinedMethodInMockAreAllowed())->isFalse()167 ->object($runner->disallowUsageOfUndefinedMethodInMock())->isIdenticalTo($runner)168 ->boolean($runner->debugModeIsEnabled())->isFalse()169 ;170 }171 public function testAllowUsageOfUndefinedMethodInMock()172 {173 $this174 ->if($runner = new testedClass())175 ->then176 ->object($runner->allowUsageOfUndefinedMethodInMock())->isIdenticalTo($runner)177 ->boolean($runner->usageOfUndefinedMethodInMockAreAllowed())->isTrue()178 ->object($runner->allowUsageOfUndefinedMethodInMock())->isIdenticalTo($runner)179 ->boolean($runner->usageOfUndefinedMethodInMockAreAllowed())->isTrue()180 ->if($runner->disallowUsageOfUndefinedMethodInMock())181 ->then182 ->object($runner->allowUsageOfUndefinedMethodInMock())->isIdenticalTo($runner)183 ->boolean($runner->usageOfUndefinedMethodInMockAreAllowed())->isTrue()184 ;185 }186 public function testSetXdebugConfig()187 {188 $this189 ->if($runner = new testedClass())190 ->then191 ->object($runner->setXdebugConfig($value = uniqid()))->isIdenticalTo($runner)192 ->string($runner->getXdebugConfig())->isEqualTo($value)193 ;194 }195 public function testAddObserver()196 {197 $this198 ->if($runner = new testedClass())199 ->then200 ->array($runner->getObservers())->isEmpty()201 ->object($runner->addObserver($observer = new \mock\atoum\atoum\observers\runner()))->isIdenticalTo($runner)202 ->array($runner->getObservers())->isEqualTo([$observer])203 ;204 }205 public function testRemoveObserver()206 {207 $this208 ->if($runner = new testedClass())209 ->then210 ->array($runner->getObservers())->isEmpty()211 ->object($runner->removeObserver(new \mock\atoum\atoum\observers\runner()))->isIdenticalTo($runner)212 ->array($runner->getObservers())->isEmpty()213 ->if($runner->addObserver($observer1 = new \mock\atoum\atoum\observers\runner()))214 ->and($runner->addObserver($observer2 = new \mock\atoum\atoum\observers\runner()))215 ->then216 ->array($runner->getObservers())->isEqualTo([$observer1, $observer2])217 ->object($runner->removeObserver(new \mock\atoum\atoum\observers\runner()))->isIdenticalTo($runner)218 ->array($runner->getObservers())->isEqualTo([$observer1, $observer2])219 ->object($runner->removeObserver($observer1))->isIdenticalTo($runner)220 ->array($runner->getObservers())->isEqualTo([$observer2])221 ->object($runner->removeObserver($observer2))->isIdenticalTo($runner)222 ->array($runner->getObservers())->isEmpty()223 ;224 }225 public function testCallObservers()226 {227 $this228 ->if($runner = new testedClass())229 ->then230 ->object($runner->callObservers(atoum\runner::runStart))->isIdenticalTo($runner)231 ->if($runner->addObserver($observer = new \mock\atoum\atoum\observers\runner()))232 ->then233 ->object($runner->callObservers(atoum\runner::runStart))->isIdenticalTo($runner)234 ->mock($observer)->call('handleEvent')->withArguments(atoum\runner::runStart, $runner)->once()235 ;236 }237 public function testGetRunningDuration()238 {239 $this240 ->if($adapter = new atoum\test\adapter())241 ->and($adapter->microtime = function () {242 static $call = 0;243 return (++$call * 100);244 })245 ->and($adapter->get_declared_classes = [])246 ->and($runner = new testedClass())247 ->and($runner->setAdapter($adapter))248 ->then249 ->variable($runner->getRunningDuration())->isNull()250 ->if($runner->run())251 ->then252 ->integer($runner->getRunningDuration())->isEqualTo(100)253 ->if(eval('namespace ' . __NAMESPACE__ . ' { class forTestGetRunningDuration extends \atoum\atoum\test { public function testSomething() {} public function run(array $runTestMethods = array(), array $tags = array()) { return $this; } } }'))254 ->and($adapter->get_declared_classes = [__NAMESPACE__ . '\forTestGetRunningDuration'])255 ->and($runner->run())256 ->then257 ->integer($runner->getRunningDuration())->isEqualTo(100)258 ;259 }260 public function testGetTestNumber()261 {262 $this263 ->if($adapter = new atoum\test\adapter())264 ->and($adapter->get_declared_classes = [])265 ->and($runner = new testedClass())266 ->and($runner->setAdapter($adapter))267 ->then268 ->integer($runner->getTestNumber())->isZero()269 ->if($runner->run())270 ->then271 ->integer($runner->getTestNumber())->isZero();272 ;273 }274 public function testGetTestMethodNumber()275 {276 $this277 ->if($adapter = new atoum\test\adapter())278 ->and($adapter->get_declared_classes = [])279 ->and($runner = new testedClass())280 ->and($runner->setAdapter($adapter))281 ->then282 ->integer($runner->getTestMethodNumber())->isZero()283 ->if($runner->run())284 ->then285 ->integer($runner->getTestMethodNumber())->isZero()286 ;287 }288 public function testGetBootstrapFile()289 {290 $this291 ->if($runner = new testedClass())292 ->and($includer = new \mock\atoum\atoum\includer())293 ->and($includer->getMockController()->includePath = function () {294 })295 ->and($runner->setIncluder($includer))296 ->then297 ->object($runner->setBootstrapFile($path = uniqid()))->isIdenticalTo($runner)298 ->string($runner->getBootstrapFile())->isEqualTo($path)299 ->mock($includer)->call('includePath')->withArguments($path)->once()300 ;301 }302 public function testGetAutoloaderFile()303 {304 $this305 ->if($runner = new testedClass())306 ->and($includer = new \mock\atoum\atoum\includer())307 ->and($includer->getMockController()->includePath = function () {308 })309 ->and($runner->setIncluder($includer))310 ->then311 ->object($runner->setAutoloaderFile($path = uniqid()))->isIdenticalTo($runner)312 ->string($runner->getAutoloaderFile())->isEqualTo($path)313 ->mock($includer)->call('includePath')->withArguments($path)->once()314 ;315 }316 public function testHasReports()317 {318 $this319 ->if($runner = new testedClass())320 ->then321 ->boolean($runner->hasReports())->isFalse()322 ->if($runner->addReport(new atoum\reports\realtime\cli()))323 ->then324 ->boolean($runner->hasReports())->isTrue()325 ;326 }327 public function testSetReport()328 {329 $this330 ->if($runner = new testedClass())331 ->then332 ->object($runner->setReport($report = new atoum\reports\realtime\cli()))->isIdenticalTo($runner)333 ->array($runner->getReports())->isEqualTo([$report])334 ->array($runner->getObservers())->contains($report)335 ->object($runner->addReport($otherReport = new atoum\reports\realtime\cli()))->isIdenticalTo($runner)336 ->array($runner->getReports())->isEqualTo([$report])337 ->array($runner->getObservers())->contains($report)338 ->object($runner->setReport($otherReport))->isIdenticalTo($runner)339 ->array($runner->getReports())->isEqualTo([$otherReport])340 ->array($runner->getObservers())->contains($otherReport)341 ->object($runner->addReport($report))->isIdenticalTo($runner)342 ->array($runner->getReports())->isEqualTo([$otherReport])343 ->array($runner->getObservers())->contains($otherReport)344 ;345 }346 public function testAddReport()347 {348 $this349 ->if($runner = new testedClass())350 ->then351 ->object($runner->addReport($report = new atoum\reports\realtime\cli()))->isIdenticalTo($runner)352 ->array($runner->getReports())->isEqualTo([$report])353 ->array($runner->getObservers())->contains($report)354 ->if($runner->setReport($otherReport = new atoum\reports\realtime\cli()))355 ->then356 ->object($runner->addReport($report = new atoum\reports\realtime\cli()))->isIdenticalTo($runner)357 ->array($runner->getReports())->isEqualTo([$otherReport])358 ->array($runner->getObservers())->contains($otherReport)359 ;360 }361 public function testRemoveReport()362 {363 $this364 ->if($runner = new testedClass())365 ->then366 ->array($runner->getReports())->isEmpty()367 ->array($runner->getObservers())->isEmpty()368 ->object($runner->removeReport(new atoum\reports\realtime\cli()))->isIdenticalTo($runner)369 ->array($runner->getReports())->isEmpty()370 ->array($runner->getObservers())->isEmpty()371 ->if($report1 = new \mock\atoum\atoum\report())372 ->and($report2 = new \mock\atoum\atoum\report())373 ->and($runner->addReport($report1)->addReport($report2))374 ->then375 ->array($runner->getReports())->isEqualTo([$report1, $report2])376 ->array($runner->getObservers())->isEqualTo([$report1, $report2])377 ->object($runner->removeReport(new atoum\reports\realtime\cli()))->isIdenticalTo($runner)378 ->array($runner->getReports())->isEqualTo([$report1, $report2])379 ->array($runner->getObservers())->isEqualTo([$report1, $report2])380 ->object($runner->removeReport($report1))->isIdenticalTo($runner)381 ->array($runner->getReports())->isEqualTo([$report2])382 ->array($runner->getObservers())->isEqualTo([$report2])383 ->object($runner->removeReport($report2))->isIdenticalTo($runner)384 ->array($runner->getReports())->isEmpty()385 ->array($runner->getObservers())->isEmpty()386 ->if($runner->setReport($otherReport = new atoum\reports\realtime\cli()))387 ->then388 ->array($runner->getReports())->isEqualTo([$otherReport])389 ->array($runner->getObservers())->isEqualTo([$otherReport])390 ->object($runner->removeReport($otherReport))->isIdenticalTo($runner)391 ->array($runner->getReports())->isEmpty()392 ->array($runner->getObservers())->isEmpty()393 ->if($runner->addReport($report1)->addReport($report2))394 ->then395 ->array($runner->getReports())->isEqualTo([$report1, $report2])396 ->array($runner->getObservers())->isEqualTo([$report1, $report2])397 ;398 }399 public function testRemoveReports()400 {401 $this402 ->if($runner = new testedClass())403 ->then404 ->array($runner->getReports())->isEmpty()405 ->array($runner->getObservers())->isEmpty()406 ->object($runner->removeReports())->isIdenticalTo($runner)407 ->array($runner->getReports())->isEmpty()408 ->array($runner->getObservers())->isEmpty()409 ->if($report1 = new \mock\atoum\atoum\report())410 ->and($report2 = new \mock\atoum\atoum\report())411 ->and($runner->addReport($report1)->addReport($report2))412 ->then413 ->array($runner->getReports())->isEqualTo([$report1, $report2])414 ->array($runner->getObservers())->isEqualTo([$report1, $report2])415 ->object($runner->removeReports())->isIdenticalTo($runner)416 ->array($runner->getReports())->isEmpty()417 ->array($runner->getObservers())->isEmpty()418 ->if($runner->setReport($otherReport = new atoum\reports\realtime\cli()))419 ->then420 ->array($runner->getReports())->isEqualTo([$otherReport])421 ->array($runner->getObservers())->isEqualTo([$otherReport])422 ->object($runner->removeReports())->isIdenticalTo($runner)423 ->array($runner->getReports())->isEmpty()424 ->array($runner->getObservers())->isEmpty()425 ->if($runner->addReport($report1)->addReport($report2))426 ->then427 ->array($runner->getReports())->isEqualTo([$report1, $report2])428 ->array($runner->getObservers())->isEqualTo([$report1, $report2])429 ->given(430 $firstReport = new \mock\atoum\atoum\report(),431 $secondReport = new \mock\atoum\atoum\report(),432 $overrideReport = new \mock\atoum\atoum\report(),433 $runner->removeReports()434 )435 ->if(436 $this->calling($firstReport)->isOverridableBy = function ($report) use ($overrideReport) {437 return $report === $overrideReport;438 },439 $this->calling($secondReport)->isOverridableBy = function ($report) use ($overrideReport) {440 return $report !== $overrideReport;441 },442 $runner->addReport($firstReport)443 )444 ->when($runner->removeReports($secondReport))445 ->then446 ->array($runner->getReports())->isEmpty447 ->array($runner->getObservers())->isEmpty448 ->if(449 $runner->addReport($firstReport),450 $runner->addReport($secondReport)451 )452 ->when($runner->removeReports($overrideReport))453 ->then454 ->array($runner->getReports())->isEqualTo([$firstReport])455 ->array($runner->getObservers())->isEqualTo([$firstReport])456 ;457 }458 public function testAddExtension()459 {460 $this461 ->if($runner = new testedClass())462 ->then463 ->object($runner->addExtension($extension = new \mock\atoum\atoum\extension()))->isIdenticalTo($runner)464 ->array(iterator_to_array($runner->getExtensions()))->isEqualTo([$extension])465 ->array($runner->getObservers())->contains($extension)466 ->mock($extension)467 ->call('setRunner')->withArguments($runner)->once()468 ->if($this->resetMock($extension))469 ->then470 ->object($runner->addExtension($extension))->isIdenticalTo($runner)471 ->array(iterator_to_array($runner->getExtensions()))->isEqualTo([$extension])472 ->array($runner->getObservers())->contains($extension)473 ->mock($extension)474 ->call('setRunner')->never();475 ;476 }477 public function testRemoveExtension()478 {479 $this480 ->if($runner = new testedClass())481 ->then482 ->object($runner->getExtensions())->isInstanceOf(atoum\extension\aggregator::class)483 ->sizeOf($runner->getExtensions())->isZero484 ->array($runner->getObservers())->isEmpty()485 ->if($extension = new \mock\atoum\atoum\extension())486 ->and(487 $this->mockClass('atoum\atoum\extension', 'otherMock', 'extension'),488 $otherExtension = new \otherMock\extension()489 )490 ->and($runner->addExtension($extension)->addExtension($otherExtension))491 ->then492 ->array(iterator_to_array($runner->getExtensions()))->isEqualTo([$extension, $otherExtension])493 ->array($runner->getObservers())->isEqualTo([$extension, $otherExtension])494 ->object($runner->removeExtension(new \mock\atoum\atoum\extension()))->isIdenticalTo($runner)495 ->array(iterator_to_array($runner->getExtensions()))->isEqualTo([$otherExtension])496 ->array($runner->getObservers())->isEqualTo([$otherExtension])497 ->if($runner->addExtension($extension))498 ->then499 ->array(iterator_to_array($runner->getExtensions()))->isEqualTo([$otherExtension, $extension])500 ->object($runner->removeExtension($extension))->isIdenticalTo($runner)501 ->array(iterator_to_array($runner->getExtensions()))->isEqualTo([$otherExtension])502 ->array($runner->getObservers())->isEqualTo([$otherExtension])503 ->if($runner->addExtension($extension))504 ->then505 ->array(iterator_to_array($runner->getExtensions()))->isEqualTo([$otherExtension, $extension])506 ->object($runner->removeExtension('mock\atoum\atoum\extension'))->isIdenticalTo($runner)507 ->array(iterator_to_array($runner->getExtensions()))->isEqualTo([$otherExtension])508 ->array($runner->getObservers())->isEqualTo([$otherExtension])509 ->object($runner->removeExtension($otherExtension))->isIdenticalTo($runner)510 ->object($runner->getExtensions())->isInstanceOf(atoum\extension\aggregator::class)511 ->sizeOf($runner->getExtensions())->isZero512 ->array($runner->getObservers())->isEmpty()513 ->if($extension = new \mock\atoum\atoum\extension())514 ->then515 ->exception(function () use ($runner, $extension) {516 $runner->removeExtension($extension);517 })518 ->isInstanceOf(atoum\exceptions\logic\invalidArgument::class)519 ->hasMessage('Extension ' . get_class($extension) . ' is not loaded')520 ;521 }522 public function testRemoveExtensions()523 {524 $this525 ->if($runner = new testedClass())526 ->then527 ->object($runner->getExtensions())->isInstanceOf(atoum\extension\aggregator::class)528 ->sizeOf($runner->getExtensions())->isZero529 ->array($runner->getObservers())->isEmpty()530 ->object($runner->removeExtensions())->isIdenticalTo($runner)531 ->object($runner->getExtensions())->isInstanceOf(atoum\extension\aggregator::class)532 ->sizeOf($runner->getExtensions())->isZero533 ->array($runner->getObservers())->isEmpty()534 ->if($extension = new \mock\atoum\atoum\extension())535 ->and(536 $this->mockClass('atoum\atoum\extension', 'otherMock', 'extension'),537 $otherExtension = new \otherMock\extension()538 )539 ->and($runner->addExtension($extension)->addExtension($otherExtension))540 ->then541 ->array(iterator_to_array($runner->getExtensions()))->isEqualTo([$extension, $otherExtension])542 ->array($runner->getObservers())->isEqualTo([$extension, $otherExtension])543 ->object($runner->removeExtensions())->isIdenticalTo($runner)544 ->object($runner->getExtensions())->isInstanceOf(atoum\extension\aggregator::class)545 ->sizeOf($runner->getExtensions())->isZero546 ->array($runner->getObservers())->isEmpty()547 ;548 }549 public function testEnableCodeCoverage()550 {551 $this552 ->if($runner = new testedClass())553 ->and($runner->disableCodeCoverage())554 ->then555 ->boolean($runner->codeCoverageIsEnabled())->isFalse()556 ->object($runner->enableCodeCoverage())->isIdenticalTo($runner)557 ->boolean($runner->codeCoverageIsEnabled())->isTrue()558 ;559 }560 public function testDisableCodeCoverage()561 {562 $this563 ->if($runner = new testedClass())564 ->and($runner->enableCodeCoverage())565 ->then566 ->boolean($runner->codeCoverageIsEnabled())->isTrue()567 ->object($runner->disableCodeCoverage())->isIdenticalTo($runner)568 ->boolean($runner->codeCoverageIsEnabled())->isFalse()569 ;570 }571 public function testSetTestFactory()572 {573 $this574 ->if($runner = new testedClass())575 ->then576 ->variable($runner->getTestFactory())->isCallable577 ->object($runner->setTestFactory())->isIdenticalTo($runner)578 ->object($runner->getTestFactory())->isCallable579 ->if($factory = function () {580 })581 ->then582 ->object($runner->setTestFactory($factory))->isIdenticalTo($runner)583 ->object($runner->getTestFactory())->isCallable584 ->given($test = new \mock\atoum\atoum\test())585 ->and($generator = new \mock\atoum\atoum\test\mock\generator($test))586 ->and($test->setMockGenerator($generator))587 ->if($runner->disallowUsageOfUndefinedMethodInMock())588 ->and($runner->setTestFactory(function () use ($test) {589 return $test;590 }))591 ->and($factory = $runner->getTestFactory())592 ->then593 ->object($factory('mock\atoum\atoum\test'))->isIdenticalTo($test)594 ->mock($generator)595 ->call('disallowUndefinedMethodUsage')->once596 ->if($this->resetMock($generator))597 ->if($runner->allowUsageOfUndefinedMethodInMock())598 ->then599 ->object($factory('mock\atoum\atoum\test'))->isIdenticalTo($test)600 ->mock($generator)601 ->call('disallowUndefinedMethodUsage')->never602 ;603 }604 public function testSetPathAndVersionInScore()605 {606 $this607 ->if($php = new \mock\atoum\atoum\php())608 ->and($this->calling($php)->getBinaryPath = $phpPath = uniqid())609 ->and($this->calling($php)->run = $php)610 ->and($this->calling($php)->isRunning = false)611 ->and($this->calling($php)->getExitCode = 0)612 ->and($this->calling($php)->getStdout = $phpVersion = uniqid())613 ->and($adapter = new atoum\test\adapter())614 ->and($adapter->defined = true)615 ->and($adapter->constant = function ($constantName) use (& $atoumVersion, & $atoumDirectory) {616 switch ($constantName) {617 case atoum\runner::atoumVersionConstant:618 return $atoumVersion = uniqid();619 case atoum\runner::atoumDirectoryConstant:620 return $atoumDirectory = uniqid();621 }622 })623 ->and($runner = new testedClass())624 ->and($runner->setPhp($php))625 ->and($runner->setAdapter($adapter))626 ->and($runner->setScore($score = new \mock\atoum\atoum\runner\score()))627 ->then628 ->object($runner->setPathAndVersionInScore())->isIdenticalTo($runner)629 ->mock($score)630 ->call('setAtoumVersion')->withArguments($atoumVersion)->once()631 ->call('setAtoumPath')->withArguments($atoumDirectory)->once()632 ->call('setPhpPath')->withArguments($phpPath)->once()633 ->call('setPhpVersion')->withArguments($phpVersion)->once()634 ->if($adapter->defined = false)635 ->and($runner->setScore($score = new \mock\atoum\atoum\runner\score()))636 ->then637 ->object($runner->setPathAndVersionInScore())->isIdenticalTo($runner)638 ->mock($score)639 ->call('setAtoumVersion')->withArguments(null)->once()640 ->call('setAtoumPath')->withArguments(null)->once()641 ->call('setPhpPath')->withArguments($phpPath)->once()642 ->call('setPhpVersion')->withArguments($phpVersion)->once()643 ->if($this->calling($php)->getExitCode = rand(1, PHP_INT_MAX))644 ->and($runner->setScore($score = new \mock\atoum\atoum\runner\score()))645 ->then646 ->exception(function () use ($runner) {647 $runner->setPathAndVersionInScore();648 })649 ->isInstanceOf(atoum\exceptions\runtime::class)650 ->hasMessage('Unable to get PHP version from \'' . $php . '\'')651 ;652 }653 public function testGetCoverage()654 {655 $this656 ->if($runner = new testedClass())657 ->then658 ->object($runner->getCoverage())->isIdenticalTo($runner->getScore()->getCoverage())659 ;660 }661 public function testAddTest()662 {663 $this664 ->if($runner = new testedClass())665 ->then666 ->object($runner->addTest($testPath1 = uniqid()))->isIdenticalTo($runner)667 ->array($runner->getTestPaths())->isEqualTo([$testPath1])668 ->object($runner->addTest($testPath2 = uniqid()))->isIdenticalTo($runner)669 ->array($runner->getTestPaths())->isEqualTo([$testPath1, $testPath2])670 ->object($runner->addTest($testPath1))->isIdenticalTo($runner)671 ->array($runner->getTestPaths())->isEqualTo([$testPath1, $testPath2])672 ->object($runner->addTest($testPath3 = new \splFileInfo(__FILE__)))->isIdenticalTo($runner)673 ->array($runner->getTestPaths())->isEqualTo([$testPath1, $testPath2, (string) $testPath3])674 ->if($runner->canNotAddTest())675 ->then676 ->object($runner->addTest($testPath4 = uniqid()))->isIdenticalTo($runner)677 ->array($runner->getTestPaths())->isEqualTo([$testPath1, $testPath2, (string) $testPath3])678 ->if($runner->canAddTest())679 ->then680 ->object($runner->addTest($testPath4 = uniqid()))->isIdenticalTo($runner)681 ->array($runner->getTestPaths())->isEqualTo([$testPath1, $testPath2, (string) $testPath3, $testPath4])682 ;683 }684 public function testCanAddTest()685 {686 $this687 ->if($runner = new testedClass())688 ->then689 ->object($runner->canAddTest())->isIdenticalTo($runner)690 ->if($runner->canNotAddTest())691 ->then692 ->object($runner->canAddTest())->isIdenticalTo($runner)693 ->if($runner->addTest(uniqid()))694 ->then695 ->array($runner->getTestPaths())->isNotEmpty()696 ;697 }698 public function testCanNotAddTest()699 {700 $this701 ->if($runner = new testedClass())702 ->then703 ->object($runner->canNotAddTest())->isIdenticalTo($runner)704 ->if($runner->addTest(uniqid()))705 ->then706 ->array($runner->getTestPaths())->isEmpty()707 ->if($runner->canAddTest())708 ->then709 ->object($runner->canNotAddTest())->isIdenticalTo($runner)710 ->if($runner->addTest(uniqid()))711 ->then712 ->array($runner->getTestPaths())->isEmpty()713 ;714 }715 public function testAcceptTestFileExtensions()716 {717 $this718 ->if($runner = new testedClass())719 ->and($runner->setTestDirectoryIterator($directoryIterator = new \mock\atoum\atoum\iterators\recursives\directory\factory()))720 ->then721 ->object($runner->acceptTestFileExtensions($testFileExtensions = [uniqid(), uniqid()]))->isIdenticalTo($runner)722 ->mock($directoryIterator)->call('acceptExtensions')->withArguments($testFileExtensions)->once()723 ;724 }725}...

Full Screen

Full Screen

getTestPaths

Using AI Code Generation

copy

Full Screen

1$runner = new Runner();2$runner->getTestPaths();3$runner = new Runner();4$runner->getTestPaths();5$runner = new Runner();6$runner->getTestPaths();7$runner = new Runner();8$runner->getTestPaths();9$runner = new Runner();10$runner->getTestPaths();11$runner = new Runner();12$runner->getTestPaths();13$runner = new Runner();14$runner->getTestPaths();15$runner = new Runner();16$runner->getTestPaths();17$runner = new Runner();18$runner->getTestPaths();19$runner = new Runner();20$runner->getTestPaths();21$runner = new Runner();22$runner->getTestPaths();23$runner = new Runner();24$runner->getTestPaths();25$runner = new Runner();26$runner->getTestPaths();27$runner = new Runner();28$runner->getTestPaths();29$runner = new Runner();30$runner->getTestPaths();31$runner = new Runner();32$runner->getTestPaths();

Full Screen

Full Screen

getTestPaths

Using AI Code Generation

copy

Full Screen

1$runner = new Runner();2$testPaths = $runner->getTestPaths();3var_dump($testPaths);4$runner = new Runner();5$testPaths = $runner->getTestPaths();6var_dump($testPaths);7$runner = new Runner();8$testPaths = $runner->getTestPaths();9var_dump($testPaths);10array(2) {11 string(13) "1.php"12 string(13) "2.php"13}14array(2) {15 string(13) "1.php"16 string(13) "2.php"17}18array(2) {19 string(13) "1.php"20 string(13) "2.php"21}22require_once "vendor/autoload.php";23$runner = new Runner();24$testPaths = $runner->getTestPaths();25var_dump($testPaths);26$runner = new Runner();27$testPaths = $runner->getTestPaths();28var_dump($testPaths);29$runner = new Runner();30$testPaths = $runner->getTestPaths();31var_dump($testPaths);32$runner = new Runner();33$testPaths = $runner->getTestPaths();34var_dump($testPaths);35array(2) {36 string(13) "1.php"37 string(13) "2.php"38}39array(2) {

Full Screen

Full Screen

getTestPaths

Using AI Code Generation

copy

Full Screen

1$runner = new Runner();2$runner->getTestPaths();3$runner = new Runner();4$runner->run();5$runner = new Runner();6$runner->getTestPaths();7$runner = new Runner();8$runner->run();9$runner = new Runner();10$runner->getTestPaths();11$runner = new Runner();12$runner->run();13$runner = new Runner();14$runner->getTestPaths();15$runner = new Runner();16$runner->run();17$runner = new Runner();18$runner->getTestPaths();19$runner = new Runner();20$runner->run();21$runner = new Runner();22$runner->getTestPaths();23$runner = new Runner();24$runner->run();25$runner = new Runner();26$runner->getTestPaths();27$runner = new Runner();28$runner->run();29$runner = new Runner();30$runner->getTestPaths();31$runner = new Runner();32$runner->run();33$runner = new Runner();34$runner->getTestPaths();

Full Screen

Full Screen

getTestPaths

Using AI Code Generation

copy

Full Screen

1require_once 'PHPUnit/TextUI/TestRunner.php';2require_once 'PHPUnit/Util/Filter.php';3require_once 'PHPUnit/Framework/TestSuite.php';4require_once 'PHPUnit/Util/Getopt.php';5require_once 'PHPUnit/Util/Log/JSON.php';6require_once 'PHPUnit/Util/Log/JUnit.php';7require_once 'PHPUnit/Util/Log/PMD.php';8require_once 'PHPUnit/Util/Log/TAP.php';9require_once 'PHPUnit/Util/Log/XML.php';10require_once 'PHPUnit/Util/PHP.php';11require_once 'PHPUnit/Util/Test.php';12require_once 'PHPUnit/Util/Printer.php';13require_once 'PHPUnit/Util/TestDox/ResultPrinter.php';14require_once 'PHPUnit/Util/TestDox/NamePrettifier.php';15require_once 'PHPUnit/Util/TestDox/ResultPrinter/Text.php';16require_once 'PHPUnit/Util/TestDox/ResultPrinter/HTML.php';17require_once 'PHPUnit/Util/TestDox/ResultPrinter/TextResultPrinter.php';18require_once 'PHPUnit/Util/TestDox/ResultPrinter/HTMLResultPrinter.php';19require_once 'PHPUnit/Util/TestDox/NamePrettifier.php';20require_once 'PHPUnit/Util/TestDox/NamePrettifier/UnderscoreSeparatedWords.php';

Full Screen

Full Screen

getTestPaths

Using AI Code Generation

copy

Full Screen

1require_once 'PHPUnit/TextUI/TestRunner.php';2$runner = new PHPUnit_TextUI_TestRunner();3$paths = $runner->getTestPaths('/path/to/test');4var_dump($paths);5require_once 'PHPUnit/TextUI/TestRunner.php';6$runner = new PHPUnit_TextUI_TestRunner();7$files = $runner->getTestFiles('/path/to/test');8var_dump($files);9require_once 'PHPUnit/TextUI/TestRunner.php';10$runner = new PHPUnit_TextUI_TestRunner();11$files = $runner->getTestFiles('/path/to/test');12var_dump($files);13require_once 'PHPUnit/TextUI/TestRunner.php';14$runner = new PHPUnit_TextUI_TestRunner();15$files = $runner->getTestFiles('/path/to/test');16var_dump($files);17require_once 'PHPUnit/TextUI/TestRunner.php';18$runner = new PHPUnit_TextUI_TestRunner();19$files = $runner->getTestFiles('/path/to/test');20var_dump($files);21require_once 'PHPUnit/TextUI/TestRunner.php';22$runner = new PHPUnit_TextUI_TestRunner();23$files = $runner->getTestFiles('/path/to/test');24var_dump($files);25require_once 'PHPUnit/TextUI/TestRunner.php';26$runner = new PHPUnit_TextUI_TestRunner();27$files = $runner->getTestFiles('/path/to/test');28var_dump($files);29require_once 'PHPUnit/TextUI/TestRunner.php';30$runner = new PHPUnit_TextUI_TestRunner();31$files = $runner->getTestFiles('/path/to/test');32var_dump($files);33require_once 'PHPUnit/TextUI/TestRunner.php';34$runner = new PHPUnit_TextUI_TestRunner();

Full Screen

Full Screen

getTestPaths

Using AI Code Generation

copy

Full Screen

1require_once 'PHPUnit/TextUI/TestRunner.php';2$testRunner = new PHPUnit_TextUI_TestRunner();3$testRunner->getTestPaths('test');4require_once 'PHPUnit/TextUI/TestRunner.php';5$testRunner = new PHPUnit_TextUI_TestRunner();6$testRunner->getTestPaths('test');7require_once 'PHPUnit/TextUI/TestRunner.php';8$testRunner = new PHPUnit_TextUI_TestRunner();9$testRunner->getTestPaths('test');10require_once 'PHPUnit/TextUI/TestRunner.php';11$testRunner = new PHPUnit_TextUI_TestRunner();12$testRunner->getTestPaths('test');13require_once 'PHPUnit/TextUI/TestRunner.php';14$testRunner = new PHPUnit_TextUI_TestRunner();15$testRunner->getTestPaths('test');16require_once 'PHPUnit/TextUI/TestRunner.php';17$testRunner = new PHPUnit_TextUI_TestRunner();18$testRunner->getTestPaths('test');19require_once 'PHPUnit/TextUI/TestRunner.php';20$testRunner = new PHPUnit_TextUI_TestRunner();21$testRunner->getTestPaths('test');22require_once 'PHPUnit/TextUI/TestRunner.php';23$testRunner = new PHPUnit_TextUI_TestRunner();24$testRunner->getTestPaths('test');25require_once 'PHPUnit/TextUI/TestRunner.php';26$testRunner = new PHPUnit_TextUI_TestRunner();27$testRunner->getTestPaths('test');

Full Screen

Full Screen

getTestPaths

Using AI Code Generation

copy

Full Screen

1$runner = new runner();2$runner->getTestPaths();3public function getTestPaths()4{5 $tests = $this->getTests();6 foreach ($tests as $test) {7 $test->getTestPath();8 }9}10public function getTestPath()11{12 $this->testPath = 'test path';13}14$runner = new runner();15$runner->getTestPaths();16public function getTestPaths()17{18 $tests = $this->getTests();19 foreach ($tests as $test) {20 echo $test->testPath;21 }22}23public function __get($name)24{25 if ($name == 'testPath') {26 $this->getTestPath();27 }28}29public function getTestPath()30{31 $this->testPath = 'test path';32}

Full Screen

Full Screen

getTestPaths

Using AI Code Generation

copy

Full Screen

1$runner = new runner();2$runner->getTestPaths();3class runner {4 public function getTestPaths() {5 $testPaths = array();6 $testPaths[] = '2.php';7 $testPaths[] = '3.php';8 return $testPaths;9 }10}11$runner = new runner();12$runner->getTestPaths();13class runner {14 public function getTestPaths() {15 $testPaths = array();16 $testPaths[] = '4.php';17 $testPaths[] = '5.php';18 return $testPaths;19 }20}21$runner = new runner();22$runner->getTestPaths();23class runner {24 public function getTestPaths() {25 $testPaths = array();26 $testPaths[] = '6.php';27 $testPaths[] = '7.php';28 return $testPaths;29 }30}31$runner = new runner();32$runner->getTestPaths();33class runner {34 public function getTestPaths() {35 $testPaths = array();36 $testPaths[] = '8.php';37 $testPaths[] = '9.php';38 return $testPaths;39 }40}41$runner = new runner();42$runner->getTestPaths();43class runner {44 public function getTestPaths() {45 $testPaths = array();46 $testPaths[] = '10.php';47 $testPaths[] = '11.php';48 return $testPaths;49 }50}51$runner = new runner();52$runner->getTestPaths();53class runner {54 public function getTestPaths() {55 $testPaths = array();

Full Screen

Full Screen

getTestPaths

Using AI Code Generation

copy

Full Screen

1require_once 'PHPUnit/Runner.php';2$runner = new PHPUnit_Runner();3$testPaths = $runner->getTestPaths();4$testFiles = $runner->getTestFiles($testPaths);5$testClasses = $runner->getTestClasses($testFiles);6$testMethods = $runner->getTestMethods($testClasses);7$runner->runTest($testMethods);

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Atoum automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in runner

Trigger getTestPaths code on LambdaTest Cloud Grid

Execute automation tests with getTestPaths on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful