How to use getErrorsDirectory method of builder class

Best Atoum code snippet using builder.getErrorsDirectory

builder.php

Source:builder.php Github

copy

Full Screen

...45 ->array($builder->getRunnerConfigurationFiles())->isEmpty()46 ->variable($builder->getVersion())->isNull()47 ->variable($builder->getWorkingDirectory())->isNull()48 ->variable($builder->getDestinationDirectory())->isNull()49 ->variable($builder->getErrorsDirectory())->isNull()50 ->variable($builder->getScoreDirectory())->isNull()51 ->variable($builder->getRevisionFile())->isNull()52 ->string($builder->getUnitTestRunnerScript())->isEqualTo(scripts\builder::defaultUnitTestRunnerScript)53 ->string($builder->getPharGeneratorScript())->isEqualTo(scripts\builder::defaultPharGeneratorScript)54 ->variable($builder->getReportTitle())->isNull()55 ->object($builder->getVcs())->isInstanceOf('mageekguy\atoum\scripts\builder\vcs\svn')56 ->variable($builder->getTaggerEngine())->isNull()57 ->if($builder = new testedClass($name = uniqid(), $adapter = new atoum\adapter()))58 ->then59 ->string($builder->getName())->isEqualTo($name)60 ->object($builder->getAdapter())->isIdenticalTo($adapter)61 ->object($builder->getLocale())->isInstanceOf('mageekguy\atoum\locale')62 ->object($builder->getArgumentsParser())->isInstanceOf('mageekguy\atoum\script\arguments\parser')63 ->object($builder->getOutputWriter())->isInstanceOf('mageekguy\atoum\writers\std\out')64 ->object($builder->getErrorWriter())->isInstanceOf('mageekguy\atoum\writers\std\err')65 ->array($builder->getRunnerConfigurationFiles())->isEmpty()66 ->variable($builder->getVersion())->isNull()67 ->variable($builder->getWorkingDirectory())->isNull()68 ->variable($builder->getDestinationDirectory())->isNull()69 ->variable($builder->getErrorsDirectory())->isNull()70 ->variable($builder->getScoreDirectory())->isNull()71 ->variable($builder->getRevisionFile())->isNull()72 ->string($builder->getUnitTestRunnerScript())->isEqualTo(scripts\builder::defaultUnitTestRunnerScript)73 ->string($builder->getPharGeneratorScript())->isEqualTo(scripts\builder::defaultPharGeneratorScript)74 ->variable($builder->getReportTitle())->isNull()75 ->object($builder->getVcs())->isInstanceOf('mageekguy\atoum\scripts\builder\vcs\svn')76 ->variable($builder->getTaggerEngine())->isNull()77 ;78 }79 public function testSetPhp()80 {81 $this82 ->if($builder = new testedClass(uniqid()))83 ->then84 ->object($builder->setPhp($php = new atoum\php()))->isIdenticalTo($builder)85 ->object($builder->getPhp())->isIdenticalTo($php)86 ->object($builder->setPhp())->isIdenticalTo($builder)87 ->object($builder->getPhp())88 ->isEqualTo(new atoum\php())89 ->isNotIdenticalTo($php)90 ;91 }92 public function testSetVersion()93 {94 $this95 ->if($builder = new testedClass(uniqid()))96 ->then97 ->object($builder->setVersion($tag = uniqid()))->isIdenticalTo($builder)98 ->string($builder->getVersion())->isIdenticalTo($tag)99 ->object($builder->setVersion($tag = rand(1, PHP_INT_MAX)))->isIdenticalTo($builder)100 ->string($builder->getVersion())->isIdenticalTo((string) $tag)101 ;102 }103 public function testGetPhpPath()104 {105 $this106 ->if($builder = new testedClass(uniqid()))107 ->then108 ->string($builder->getPhpPath())->isEqualTo($builder->getPhp()->getBinaryPath())109 ;110 }111 public function testSetPhpPath()112 {113 $this114 ->if($builder = new testedClass(uniqid()))115 ->then116 ->object($builder->setPhpPath($phpPath = uniqid()))->isIdenticalTo($builder)117 ->string($builder->getPhpPath())->isIdenticalTo($phpPath)118 ;119 }120 public function testSetReportTitle()121 {122 $this123 ->if($builder = new testedClass(uniqid()))124 ->then125 ->object($builder->setReportTitle($reportTitle = uniqid()))->isIdenticalTo($builder)126 ->string($builder->getReportTitle())->isEqualTo($reportTitle)127 ->object($builder->setReportTitle($reportTitle = rand(- PHP_INT_MAX, PHP_INT_MAX)))->isIdenticalTo($builder)128 ->string($builder->getReportTitle())->isEqualTo((string) $reportTitle)129 ;130 }131 public function testSetVcs()132 {133 $this134 ->if($builder = new testedClass(uniqid()))135 ->and->mockGenerator->shunt('__construct')136 ->then137 ->object($builder->setVcs($vcs = new \mock\mageekguy\atoum\scripts\builder\vcs()))->isIdenticalTo($builder)138 ->object($builder->getVcs())->isIdenticalTo($vcs)139 ;140 }141 public function testSetTaggerEngine()142 {143 $this->assert144 ->if($builder = new testedClass(uniqid()))145 ->then146 ->object($builder->setTaggerEngine($taggerEngine = new atoum\scripts\tagger\engine()))->isIdenticalTo($builder)147 ->object($builder->getTaggerEngine())->isIdenticalTo($taggerEngine)148 ;149 }150 public function testSetUnitTestRunnerScript()151 {152 $this153 ->if($builder = new testedClass(uniqid()))154 ->then155 ->object($builder->setUnitTestRunnerScript($php = uniqid()))->isIdenticalTo($builder)156 ->string($builder->getUnitTestRunnerScript())->isIdenticalTo($php)157 ->object($builder->setUnitTestRunnerScript($php = rand(1, PHP_INT_MAX)))->isIdenticalTo($builder)158 ->string($builder->getUnitTestRunnerScript())->isIdenticalTo((string) $php)159 ;160 }161 public function testSetPharGeneratorScript()162 {163 $this164 ->if($builder = new testedClass(uniqid()))165 ->then166 ->object($builder->setPharGeneratorScript($php = uniqid()))->isIdenticalTo($builder)167 ->string($builder->getPharGeneratorScript())->isIdenticalTo($php)168 ->object($builder->setPharGeneratorScript($php = rand(1, PHP_INT_MAX)))->isIdenticalTo($builder)169 ->string($builder->getPharGeneratorScript())->isIdenticalTo((string) $php)170 ;171 }172 public function testSetScoreDirectory()173 {174 $this175 ->if($builder = new testedClass(uniqid()))176 ->then177 ->object($builder->setScoreDirectory($scoreDirectory = uniqid()))->isIdenticalTo($builder)178 ->string($builder->getScoreDirectory())->isEqualTo($scoreDirectory)179 ->object($builder->setScoreDirectory($directory = rand(- PHP_INT_MAX, PHP_INT_MAX)))->isIdenticalTo($builder)180 ->string($builder->getScoreDirectory())->isEqualTo($directory)181 ->object($builder->setScoreDirectory(($directory = uniqid()) . DIRECTORY_SEPARATOR))->isIdenticalTo($builder)182 ->string($builder->getScoreDirectory())->isEqualTo($directory)183 ;184 }185 public function testSetErrorsDirectory()186 {187 $this188 ->if($builder = new testedClass(uniqid()))189 ->then190 ->object($builder->setErrorsDirectory($errorsDirectory = uniqid()))->isIdenticalTo($builder)191 ->string($builder->getErrorsDirectory())->isEqualTo($errorsDirectory)192 ->object($builder->setErrorsDirectory($directory = rand(- PHP_INT_MAX, PHP_INT_MAX)))->isIdenticalTo($builder)193 ->string($builder->getErrorsDirectory())->isEqualTo($directory)194 ->object($builder->setErrorsDirectory(($directory = uniqid()) . DIRECTORY_SEPARATOR))->isIdenticalTo($builder)195 ->string($builder->getErrorsDirectory())->isEqualTo($directory)196 ;197 }198 public function testSetDestinationDirectory()199 {200 $this->assert201 ->if($builder = new testedClass(uniqid()))202 ->then203 ->object($builder->setDestinationDirectory($directory = uniqid()))->isIdenticalTo($builder)204 ->string($builder->getDestinationDirectory())->isEqualTo($directory)205 ->object($builder->setDestinationDirectory($directory = rand(- PHP_INT_MAX, PHP_INT_MAX)))->isIdenticalTo($builder)206 ->string($builder->getDestinationDirectory())->isEqualTo($directory)207 ->object($builder->setDestinationDirectory(($directory = uniqid()) . DIRECTORY_SEPARATOR))->isIdenticalTo($builder)208 ->string($builder->getDestinationDirectory())->isEqualTo($directory)209 ;210 }211 public function testSetWorkingDirectory()212 {213 $this214 ->if($builder = new testedClass(uniqid()))215 ->then216 ->object($builder->setWorkingDirectory($directory = uniqid()))->isIdenticalTo($builder)217 ->string($builder->getWorkingDirectory())->isEqualTo($directory)218 ->object($builder->setWorkingDirectory($directory = rand(- PHP_INT_MAX, PHP_INT_MAX)))->isIdenticalTo($builder)219 ->string($builder->getWorkingDirectory())->isEqualTo((string) $directory)220 ->object($builder->setWorkingDirectory(($directory = uniqid()) . DIRECTORY_SEPARATOR))->isIdenticalTo($builder)221 ->string($builder->getWorkingDirectory())->isEqualTo($directory)222 ;223 }224 public function testSetRevisionFile()225 {226 $this227 ->if($builder = new testedClass(uniqid()))228 ->then229 ->object($builder->setRevisionFile($file = uniqid()))->isIdenticalTo($builder)230 ->string($builder->getRevisionFile())->isEqualTo($file)231 ;232 }233 public function testAddRunnerConfigurationFile()234 {235 $this236 ->if($builder = new testedClass(uniqid()))237 ->then238 ->object($builder->addRunnerConfigurationFile($file = uniqid()))->isIdenticalTo($builder)239 ->array($builder->getRunnerConfigurationFiles())->isEqualTo(array($file))240 ;241 }242 public function testSetRunFile()243 {244 $this245 ->if($builder = new testedClass(uniqid()))246 ->then247 ->object($builder->setRunFile($runFile = uniqid()))->isIdenticalTo($builder)248 ->string($builder->getRunFile())->isEqualTo($runFile)249 ;250 }251 public function testDisableUnitTestChecking()252 {253 $this254 ->if($builder = new testedClass(uniqid()))255 ->then256 ->boolean($builder->unitTestCheckingIsEnabled())->isTrue()257 ->object($builder->disableUnitTestChecking())->isIdenticalTo($builder)258 ->boolean($builder->unitTestCheckingIsEnabled())->isFalse()259 ;260 }261 public function testEnableUnitTestChecking()262 {263 $this264 ->if($builder = new testedClass(uniqid()))265 ->and($builder->disableUnitTestChecking())266 ->then267 ->boolean($builder->unitTestCheckingIsEnabled())->isFalse()268 ->object($builder->enableUnitTestChecking())->isIdenticalTo($builder)269 ->boolean($builder->unitTestCheckingIsEnabled())->isTrue()270 ;271 }272 public function testCheckUnitTests()273 {274 $this275 ->if($builder = new \mock\mageekguy\atoum\scripts\builder(uniqid(), $adapter = new atoum\test\adapter()))276 ->and($builder->disableUnitTestChecking())277 ->then278 ->boolean($builder->unitTestCheckingIsEnabled())->isFalse()279 ->boolean($builder->checkUnitTests())->isTrue()280 ->if($builder->enableUnitTestChecking())281 ->then282 ->exception(function() use ($builder) {283 $builder->checkUnitTests();284 }285 )286 ->isInstanceOf('mageekguy\atoum\exceptions\logic')287 ->hasMessage('Unable to check unit tests, working directory is undefined')288 ->if->mockGenerator->shunt('__construct')289 ->and($vcs = new \mock\mageekguy\atoum\scripts\builder\vcs())290 ->and($this->calling($vcs)->exportRepository = function() {})291 ->and($builder->setVcs($vcs))292 ->and($php = new \mock\mageekguy\atoum\php())293 ->and($this->calling($php)->run = $php)294 ->and($builder->setPhp($php))295 ->and($builder->setWorkingDirectory($workingDirectory = uniqid()))296 ->and($builder->setUnitTestRunnerScript($unitTestRunnerScript = uniqid()))297 ->and($builder->setReportTitle($reportTitle = uniqid()))298 ->and($builder->addRunnerConfigurationFile($runnerConfigurationFile = uniqid()))299 ->and($score = new \mock\mageekguy\atoum\score())300 ->and($this->calling($score)->getFailNumber = 0)301 ->and($this->calling($score)->getExceptionNumber = 0)302 ->and($this->calling($score)->getErrorNumber = 0)303 ->and($adapter->sys_get_temp_dir = $tempDirectory = uniqid())304 ->and($adapter->tempnam = $scoreFile = uniqid())305 ->and($adapter->file_get_contents = $scoreFileContents = uniqid())306 ->and($adapter->unserialize = $score)307 ->and($adapter->unlink = true)308 ->and($this->calling($builder)->writeErrorInErrorsDirectory = function() {})309 ->then310 ->boolean($builder->checkUnitTests())->isTrue()311 ->mock($vcs)312 ->call('setWorkingDirectory')->withArguments($workingDirectory)->once()313 ->call('exportRepository')->once()314 ->adapter($adapter)315 ->call('sys_get_temp_dir')->once()316 ->call('tempnam')->withArguments($tempDirectory, '')->once()317 ->call('file_get_contents')->withArguments($scoreFile)->once()318 ->call('unserialize')->withArguments($scoreFileContents)->once()319 ->call('unlink')->withArguments($scoreFile)->once()320 ->mock($score)321 ->call('getFailNumber')->once()322 ->call('getExceptionNumber')->once()323 ->call('getErrorNumber')->once()324 ->mock($php)325 ->call('reset')326 ->before($this->mock($php)->call('run'))327 ->once()328 ->call('addOption')->withArguments('-f', $workingDirectory . \DIRECTORY_SEPARATOR . $unitTestRunnerScript)329 ->before($this->mock($php)->call('run'))330 ->once()331 ->call('addArgument')->withArguments('-ncc')332 ->before($this->mock($php)->call('run'))333 ->once()334 ->call('addArgument')->withArguments('-d', $workingDirectory . \DIRECTORY_SEPARATOR . 'tests' . \DIRECTORY_SEPARATOR . 'units' . \DIRECTORY_SEPARATOR . 'classes')335 ->before($this->mock($php)->call('run'))336 ->once()337 ->call('addArgument')->withArguments('-p', $php->getBinaryPath())338 ->before($this->mock($php)->call('run'))339 ->once()340 ->call('addArgument')->withArguments('-sf', $scoreFile)341 ->before($this->mock($php)->call('run'))342 ->once()343 ->call('addArgument')->withArguments('-c', $runnerConfigurationFile)344 ->before($this->mock($php)->call('run'))345 ->once()346 ->if($this->calling($php)->getExitCode = 127)347 ->then348 ->boolean($builder->checkUnitTests())->isFalse()349 ->mock($builder)350 ->call('writeErrorInErrorsDirectory')->withArguments('Unable to find \'' . $php->getBinaryPath() . '\' or it is not executable')->once()351 ->if($this->calling($php)->getExitCode = $exitCode = rand(1, 125))352 ->and($this->calling($php)->getStdErr = $stdErr = uniqid())353 ->then354 ->boolean($builder->checkUnitTests())->isFalse()355 ->mock($builder)356 ->call('writeErrorInErrorsDirectory')->withArguments($php . ' failed with exit code \'' . $exitCode . '\': ' . $stdErr)->once()357 ->if($this->calling($php)->getExitCode = $exitCode = rand(128, PHP_INT_MAX))358 ->then359 ->boolean($builder->checkUnitTests())->isFalse()360 ->mock($builder)361 ->call('writeErrorInErrorsDirectory')->withArguments($php . ' failed with exit code \'' . $exitCode . '\': ' . $stdErr)->once()362 ->if($this->calling($php)->getExitCode = 0)363 ->and($this->calling($php)->getStdErr = '')364 ->then365 ->boolean($builder->checkUnitTests())->isTrue()366 ->if($this->calling($php)->getStdErr = $stdErrContents = uniqid())367 ->then368 ->boolean($builder->checkUnitTests())->isFalse()369 ->mock($builder)370 ->call('writeErrorInErrorsDirectory')->withArguments($stdErrContents)->once()371 ->if($this->calling($php)->getStdErr = '')372 ->and($adapter->file_get_contents = false)373 ->and($this->resetMock($builder))374 ->then375 ->boolean($builder->checkUnitTests())->isFalse()376 ->mock($builder)377 ->call('writeErrorInErrorsDirectory')->withArguments('Unable to read score from file \'' . $scoreFile . '\'')->once()378 ->if($adapter->file_get_contents = $scoreFileContents)379 ->and($adapter->unserialize = false)380 ->then381 ->boolean($builder->checkUnitTests())->isFalse()382 ->mock($builder)383 ->call('writeErrorInErrorsDirectory')->withArguments('Unable to unserialize score from file \'' . $scoreFile . '\'')->once()384 ->if($adapter->unserialize = uniqid())385 ->then386 ->boolean($builder->checkUnitTests())->isFalse()387 ->mock($builder)388 ->call('writeErrorInErrorsDirectory')->withArguments('Contents of file \'' . $scoreFile . '\' is not a score')->once()389 ->if($adapter->unserialize = $score)390 ->and($adapter->unlink = false)391 ->then392 ->exception(function() use ($builder) {393 $builder->checkUnitTests();394 }395 )396 ->isInstanceOf('mageekguy\atoum\exceptions\runtime')397 ->hasMessage('Unable to delete score file \'' . $scoreFile . '\'')398 ->if($adapter->unlink = true)399 ->and($this->calling($score)->getFailNumber = rand(1, PHP_INT_MAX))400 ->then401 ->boolean($builder->checkUnitTests())->isFalse()402 ->if($this->calling($score)->getFailNumber = 0)403 ->and($this->calling($score)->getExceptionNumber = rand(1, PHP_INT_MAX))404 ->then405 ->boolean($builder->checkUnitTests())->isFalse()406 ->if($this->calling($score)->getExceptionNumber = 0)407 ->and($this->calling($score)->getErrorNumber = rand(1, PHP_INT_MAX))408 ->then409 ->boolean($builder->checkUnitTests())->isFalse()410 ;411 }412 public function testDisablePharCreation()413 {414 $this415 ->if($builder = new testedClass(uniqid()))416 ->then417 ->boolean($builder->pharCreationIsEnabled())->isTrue()418 ->object($builder->disablePharCreation())->isIdenticalTo($builder)419 ->boolean($builder->pharCreationIsEnabled())->isFalse()420 ;421 }422 public function testEnablePharCreation()423 {424 $this425 ->if($builder = new testedClass(uniqid()))426 ->and($builder->disablePharCreation())427 ->then428 ->boolean($builder->pharCreationIsEnabled())->isFalse()429 ->object($builder->enablePharCreation())->isIdenticalTo($builder)430 ->boolean($builder->pharCreationIsEnabled())->isTrue()431 ;432 }433 public function testCreatePhar()434 {435 $this436 ->if($builder = new \mock\mageekguy\atoum\scripts\builder(uniqid(), $adapter = new atoum\test\adapter()))437 ->and($builder->setTaggerEngine($taggerEngine = new \mock\mageekguy\atoum\scripts\tagger\engine()))438 ->and($this->calling($taggerEngine)->tagVersion = function() {})439 ->and($builder->disablePharCreation())440 ->then441 ->boolean($builder->createPhar())->isTrue()442 ->if($builder->enablePharCreation())443 ->and->mockGenerator->shunt('__construct')444 ->and($builder->setVcs($vcs = new \mock\mageekguy\atoum\scripts\builder\vcs()))445 ->and($this->calling($vcs)->getNextRevisions = array())446 ->and($this->calling($vcs)->exportRepository = function() {})447 ->then448 ->exception(function() use ($builder) {449 $builder->createPhar();450 }451 )452 ->isInstanceOf('mageekguy\atoum\exceptions\logic')453 ->hasMessage('Unable to create phar, destination directory is undefined')454 ->if($builder->setDestinationDirectory($destinationDirectory = uniqid()))455 ->then456 ->exception(function() use ($builder) {457 $builder->createPhar();458 }459 )460 ->isInstanceOf('mageekguy\atoum\exceptions\logic')461 ->hasMessage('Unable to create phar, working directory is undefined')462 ->if($builder->setWorkingDirectory($workingDirectory = uniqid()))463 ->and($builder->setPhp($php = new \mock\mageekguy\atoum\php()))464 ->and($this->calling($php)->run = $php)465 ->and($builder->setPharGeneratorScript($pharGeneratorScript = uniqid()))466 ->and($this->calling($builder)->writeErrorInErrorsDirectory = function() {})467 ->and($adapter->file_get_contents = false)468 ->then469 ->boolean($builder->createPhar())->isTrue()470 ->if($this->calling($vcs)->getNextRevisions = function() use (& $revision) { static $i = 0; return ++$i > 1 ? array() : array($revision = rand(1, PHP_INT_MAX)); })471 ->and($builder->disableUnitTestChecking())472 ->and($this->calling($php)->getExitCode = rand(1, PHP_INT_MAX))473 ->and($this->calling($php)->getStderr = $stderr = uniqid())474 ->then475 ->boolean($builder->createPhar())->isFalse()476 ->mock($builder)477 ->call('writeErrorInErrorsDirectory')->withArguments('Unable to run ' . $php . ': ' . $stderr)->once()478 ->mock($vcs)479 ->call('setRevision')->withArguments($revision)->once()480 ->call('setWorkingDirectory')->withArguments($workingDirectory)->once()481 ->call('exportRepository')->once()482 ->if($this->calling($php)->getExitCode = 0)483 ->and($adapter->date = $date = uniqid())484 ->and($this->calling($vcs)->getNextRevisions = function() use (& $revision) { static $i = 0; return ++$i > 1 ? array() : array($revision = rand(1, PHP_INT_MAX)); })485 ->and($this->resetMock($vcs))486 ->then487 ->boolean($builder->createPhar())->isTrue()488 ->mock($taggerEngine)489 ->call('setVersion')490 ->withArguments('nightly-' . $revision . '-' . $date)491 ->once()492 ->call('tagVersion')->atLeastOnce()493 ->mock($vcs)494 ->call('setRevision')->withArguments($revision)->once()495 ->call('setWorkingDirectory')->withArguments($workingDirectory)->once()496 ->call('exportRepository')->once()497 ->if($this->resetMock($vcs))498 ->and($this->resetMock($taggerEngine))499 ->and($this->calling($vcs)->getNextRevisions = function() use (& $revision) { static $i = 0; return ++$i > 1 ? array() : array($revision = rand(1, PHP_INT_MAX)); })500 ->then501 ->boolean($builder->createPhar($tag = uniqid()))->isTrue()502 ->mock($taggerEngine)503 ->call('setVersion')->withArguments($tag)->once()504 ->call('tagVersion')->once()505 ->mock($vcs)506 ->call('setRevision')->withArguments($revision)->once()507 ->call('setWorkingDirectory')->withArguments($workingDirectory)->once()508 ->call('exportRepository')->once()509 ->if($builder->setRevisionFile($revisionFile = uniqid()))510 ->and($adapter->file_get_contents = false)511 ->and($adapter->file_put_contents = function() {})512 ->and($this->resetMock($vcs))513 ->and($this->calling($vcs)->getNextRevisions = function() use (& $revision) { static $i = 0; return ++$i > 1 ? array() : array($revision = rand(1, PHP_INT_MAX)); })514 ->then515 ->boolean($builder->createPhar())->isTrue()516 ->adapter($adapter)517 ->call('file_get_contents')->withArguments($revisionFile)->once()518 ->call('file_put_contents')->withArguments($revisionFile, $revision, \LOCK_EX)->once()519 ->mock($vcs)520 ->call('setRevision')->withArguments($revision)->once()521 ->call('setWorkingDirectory')->withArguments($workingDirectory)->once()522 ->call('exportRepository')->once()523 ->if($this->resetMock($vcs))524 ->and($this->calling($vcs)->getNextRevisions = function() use (& $revision) { static $i = 0; return ++$i > 1 ? array() : array($revision = rand(1, PHP_INT_MAX)); })525 ->and($adapter->file_put_contents = false)526 ->then527 ->exception(function() use ($builder) {528 $builder->createPhar();529 }530 )531 ->isInstanceOf('mageekguy\atoum\exceptions\runtime')532 ->hasMessage('Unable to save last revision in file \'' . $revisionFile . '\'')533 ->if($this->resetMock($vcs))534 ->and($this->calling($vcs)->getNextRevisions[1] = array(1, 2, 3))535 ->and($this->calling($vcs)->getNextRevisions[2] = array(2, 3))536 ->and($this->calling($vcs)->getNextRevisions[3] = array(3))537 ->and($this->calling($vcs)->getNextRevisions[4] = array())538 ->and($adapter->file_put_contents = function() {})539 ->and($adapter->resetCalls())540 ->then541 ->boolean($builder->createPhar())->isTrue()542 ->adapter($adapter)543 ->call('file_get_contents')->withArguments($revisionFile)->once()544 ->call('file_put_contents')->withArguments($revisionFile, 3, \LOCK_EX)->once()545 ->mock($vcs)546 ->call('setRevision')->withArguments(1)->once()547 ->call('setRevision')->withArguments(2)->once()548 ->call('setRevision')->withArguments(3)->once()549 ->call('setWorkingDirectory')->withArguments($workingDirectory)->atLeastOnce()550 ->call('exportRepository')->atLeastOnce()551 ->if($this->resetMock($vcs))552 ->and($this->calling($vcs)->getNextRevisions[1] = array(4))553 ->and($this->calling($vcs)->getNextRevisions[2] = array())554 ->and($adapter->file_get_contents = 1)555 ->and($adapter->resetCalls())556 ->then557 ->boolean($builder->createPhar())->isTrue()558 ->adapter($adapter)559 ->call('file_get_contents')->withArguments($revisionFile)->once()560 ->call('file_put_contents')->withArguments($revisionFile, 4, \LOCK_EX)->once()561 ->mock($vcs)562 ->call('setRevision')->withArguments(4)->once()563 ->call('setWorkingDirectory')->withArguments($workingDirectory)->once()564 ->call('exportRepository')->once()565 ;566 }567 public function testRun()568 {569 $this570 ->if($adapter = new atoum\test\adapter())571 ->and($adapter->file_get_contents = false)572 ->and($adapter->fopen = $runFileResource = uniqid())573 ->and($adapter->flock = true)574 ->and($adapter->getmypid = $pid = uniqid())575 ->and($adapter->fwrite = function() {})576 ->and($adapter->fclose = function() {})577 ->and($adapter->unlink = function() {})578 ->and($builder = new \mock\mageekguy\atoum\scripts\builder(uniqid(), $adapter))579 ->and($builder->setRunFile($runFile = uniqid()))580 ->and($this->calling($builder)->createPhar = function() {})581 ->then582 ->object($builder->run())->isIdenticalTo($builder)583 ->mock($builder)->call('createPhar')->once()584 ->adapter($adapter)585 ->call('file_get_contents')->withArguments($runFile)->once()586 ->call('fopen')->withArguments($runFile, 'w+')->once()587 ->call('flock')->withArguments($runFileResource, \LOCK_EX | \LOCK_NB)->once()588 ->call('fwrite')->withArguments($runFileResource, $pid)->once()589 ->call('fclose')->withArguments($runFileResource)->once()590 ->call('unlink')->withArguments($runFile)->once()591 ;592 }593 public function testWriteInErrorDirectory()594 {595 $this596 ->if($adapter = new atoum\test\adapter())597 ->and($adapter->file_put_contents = function() {})598 ->and($builder = new testedClass(uniqid(), $adapter))599 ->then600 ->variable($builder->getErrorsDirectory())->isNull()601 ->object($builder->writeErrorInErrorsDirectory(uniqid()))->isIdenticalTo($builder)602 ->adapter($adapter)->call('file_put_contents')->never()603 ->if($builder->setErrorsDirectory($errorDirectory = uniqid()))604 ->then605 ->string($builder->getErrorsDirectory())->isEqualTo($errorDirectory)606 ->exception(function() use ($builder) {607 $builder->writeErrorInErrorsDirectory(uniqid());608 }609 )610 ->isInstanceOf('mageekguy\atoum\exceptions\logic')611 ->hasMessage('Revision is undefined')612 ->adapter($adapter)->call('file_put_contents')->never()613 ->if->mockGenerator->shunt('__construct')614 ->and($builder->setVcs($vcs = new \mock\mageekguy\atoum\scripts\builder\vcs()))615 ->and($vcs->setRevision($revision = rand(1, PHP_INT_MAX)))616 ->then617 ->string($builder->getErrorsDirectory())->isEqualTo($errorDirectory)618 ->object($builder->writeErrorInErrorsDirectory($message = uniqid()))->isIdenticalTo($builder)619 ->adapter($adapter)->call('file_put_contents')->withArguments($errorDirectory . \DIRECTORY_SEPARATOR . $revision, $message, \LOCK_EX | \FILE_APPEND)->once()620 ->if($adapter->resetCalls())621 ->and($adapter->file_put_contents = false)622 ->then623 ->string($builder->getErrorsDirectory())->isEqualTo($errorDirectory)624 ->exception(function() use ($builder, & $message) {625 $builder->writeErrorInErrorsDirectory($message = uniqid());626 }627 )628 ->isInstanceOf('mageekguy\atoum\exceptions\runtime')629 ->hasMessage('Unable to save error in file \'' . $errorDirectory . \DIRECTORY_SEPARATOR . $revision . '\'')630 ->adapter($adapter)->call('file_put_contents')->withArguments($errorDirectory . \DIRECTORY_SEPARATOR . $revision, $message, \LOCK_EX | \FILE_APPEND)->once()631 ;632 }633}...

Full Screen

Full Screen

getErrorsDirectory

Using AI Code Generation

copy

Full Screen

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

Full Screen

Full Screen

getErrorsDirectory

Using AI Code Generation

copy

Full Screen

1$builder = new \Phalcon\Mvc\View\Engine\Volt\Compiler();2$builder->setOptions(array(3));4$builder->getErrorsDirectory();5$builder = new \Phalcon\Mvc\View\Engine\Volt\Compiler();6$builder->setOptions(array(7));8$builder->getOptions();9$builder = new \Phalcon\Mvc\View\Engine\Volt\Compiler();10$builder->setOptions(array(11));12$builder->getTemplatePath();13$builder = new \Phalcon\Mvc\View\Engine\Volt\Compiler();14$builder->setOptions(array(15));16$builder->getUniquePrefix();17$builder = new \Phalcon\Mvc\View\Engine\Volt\Compiler();18$builder->setOptions(array(19));20$builder->getTempPath();21$builder = new \Phalcon\Mvc\View\Engine\Volt\Compiler();22$builder->setOptions(array(23));24$builder->getCompiledPath();25$builder = new \Phalcon\Mvc\View\Engine\Volt\Compiler();26$builder->setOptions(array(

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.

Trigger getErrorsDirectory code on LambdaTest Cloud Grid

Execute automation tests with getErrorsDirectory 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