How to use calls class

Best Atoum code snippet using calls

calls.php

Source:calls.php Github

copy

Full Screen

...3require __DIR__ . '/../../../runner.php';4use5 mageekguy\atoum,6 mageekguy\atoum\test\adapter,7 mageekguy\atoum\test\adapter\calls as testedClass,8 mock\mageekguy\atoum\test\adapter\calls as mockedTestedClass9;10class calls extends atoum\test11{12 public function testClass()13 {14 $this->testedClass15 ->implements('countable')16 ->implements('arrayAccess')17 ->implements('iteratorAggregate')18 ;19 }20 public function test__construct()21 {22 $this23 ->if($calls = new testedClass())24 ->then25 ->sizeof($calls)->isZero()26 ;27 }28 public function test__invoke()29 {30 $this31 ->if($calls = new testedClass())32 ->then33 ->array($calls())->isEmpty()34 ->if($calls[] = $call = new adapter\call(uniqid()))35 ->then36 ->array($calls())->isEqualTo(array($call->getFunction() => array(1 => $call)))37 ->object[$call->getFunction()][1]->isIdenticalTo($call)38 ->if($calls[] = $otherCall = new adapter\call($call->getFunction()))39 ->then40 ->array($calls())->isEqualTo(array($call->getFunction() => array(1 => $call, 2 => $otherCall)))41 ->object[$call->getFunction()][1]->isIdenticalTo($call)42 ->object[$call->getFunction()][2]->isIdenticalTo($otherCall)43 ->object[$otherCall->getFunction()][2]->isIdenticalTo($otherCall)44 ->if($calls[] = $anotherCall = new adapter\call(uniqid()))45 ->then46 ->array($calls())->isEqualTo(array(47 $call->getFunction() => array(1 => $call, 2 => $otherCall),48 $anotherCall->getFunction() => array(3 => $anotherCall)49 )50 )51 ->object[$call->getFunction()][1]->isIdenticalTo($call)52 ->object[$call->getFunction()][2]->isIdenticalTo($otherCall)53 ->object[$otherCall->getFunction()][2]->isIdenticalTo($otherCall)54 ->object[$anotherCall->getFunction()][3]->isIdenticalTo($anotherCall)55 ;56 }57 public function test__toString()58 {59 $this60 ->if($calls = new testedClass())61 ->then62 ->castToString($calls)->isEqualTo($calls->getDecorator()->decorate($calls))63 ;64 }65 public function testCount()66 {67 $this68 ->if($calls = new testedClass())69 ->then70 ->sizeof($calls)->isZero()71 ->if($calls[] = $call1 = new adapter\call(uniqid()))72 ->then73 ->sizeof($calls)->isEqualTo(1)74 ->if($otherCalls = new testedClass())75 ->and($otherCalls[] = $call2 = new adapter\call(uniqid()))76 ->then77 ->sizeof($calls)->isEqualTo(1)78 ->sizeof($otherCalls)->isEqualTo(1)79 ->if($calls[] = $call2 = new adapter\call(uniqid()))80 ->then81 ->sizeof($calls)->isEqualTo(2)82 ->sizeof($otherCalls)->isEqualTo(1)83 ->if($calls[] = $call3 = new adapter\call($call1->getFunction()))84 ->then85 ->sizeof($calls)->isEqualTo(3)86 ->sizeof($otherCalls)->isEqualTo(1)87 ;88 }89 public function testSetDecorator()90 {91 $this92 ->if($calls = new testedClass())93 ->then94 ->object($calls->setDecorator($decorator = new adapter\calls\decorator()))->isIdenticalTo($calls)95 ->object($calls->getDecorator())->isIdenticalTo($decorator)96 ->object($calls->setDecorator())->isIdenticalTo($calls)97 ->object($calls->getDecorator())98 ->isNotIdenticalTo($decorator)99 ->isEqualTo(new adapter\calls\decorator())100 ;101 }102 public function testReset()103 {104 $this105 ->if($calls = new testedClass())106 ->then107 ->object($calls->reset())->isIdenticalTo($calls)108 ->sizeof($calls)->isZero()109 ->if($calls[] = new adapter\call(uniqid()))110 ->then111 ->object($calls->reset())->isIdenticalTo($calls)112 ->sizeof($calls)->isZero()113 ->if($calls[] = $call = new adapter\call(uniqid()))114 ->then115 ->array($calls[$call->getFunction()]->toArray())->isEqualTo(array(2 => $call))116 ;117 }118 public function testAddCall()119 {120 $this121 ->if($calls = new testedClass())122 ->then123 ->object($calls->addCall($call = new adapter\call(uniqid())))->isIdenticalTo($calls)124 ->array($calls[$call->getFunction()]->toArray())125 ->isEqualTo(array(1 => $call))126 ->object[1]->isIdenticalTo($call)127 ;128 }129 public function testRemoveCall()130 {131 $this132 ->if($calls = new testedClass())133 ->then134 ->object($calls->removeCall(new adapter\call(uniqid()), rand(0, PHP_INT_MAX)))->isIdenticalTo($calls)135 ->sizeof($calls)->isZero()136 ->if($calls->addCall($call = new adapter\call(uniqid())))137 ->then138 ->object($calls->removeCall(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isIdenticalTo($calls)139 ->sizeof($calls)->isEqualTo(1)140 ->object($calls->removeCall($call, rand(2, PHP_INT_MAX)))->isIdenticalTo($calls)141 ->sizeof($calls)->isEqualTo(1)142 ->object($calls->removeCall($call, 1))->isIdenticalTo($calls)143 ->sizeof($calls)->isZero()144 ;145 }146 public function testOffsetSet()147 {148 $this149 ->if($calls = new testedClass())150 ->then151 ->exception(function() use ($calls) { $calls[] = new adapter\call(); })152 ->isInstanceOf('mageekguy\atoum\exceptions\logic\invalidArgument')153 ->hasMessage('Function is undefined')154 ->if($calls[] = $call1 = new adapter\call(uniqid()))155 ->then156 ->array($calls[$call1]->toArray())157 ->isEqualTo(array(1 => $call1))158 ->object[1]->isIdenticalTo($call1)159 ->if($calls[] = $call2 = new adapter\call(uniqid(), array()))160 ->then161 ->array($calls[$call1]->toArray())162 ->isEqualTo(array(1 => $call1))163 ->object[1]->isIdenticalTo($call1)164 ->array($calls[$call2]->toArray())165 ->isEqualTo(array(2 => $call2))166 ->object[2]->isIdenticalTo($call2)167 ->if($calls[] = $call3 = new adapter\call($call1->getFunction(), array()))168 ->then169 ->array($calls[$call1]->toArray())170 ->isEqualTo(array(1 => $call1, 3 => $call3))171 ->object[1]->isIdenticalTo($call1)172 ->object[3]->isIdenticalTo($call3)173 ->array($calls[$call2]->toArray())174 ->isEqualTo(array(2 => $call2))175 ->object[2]->isIdenticalTo($call2)176 ->if($calls[] = $call4 = new adapter\call(uniqid()))177 ->then178 ->array($calls[$call1]->toArray())179 ->isEqualTo(array(1 => $call1, 3 => $call3))180 ->object[1]->isIdenticalTo($call1)181 ->object[3]->isIdenticalTo($call3)182 ->array($calls[$call2]->toArray())183 ->isEqualTo(array(2 => $call2))184 ->object[2]->isIdenticalTo($call2)185 ->array($calls[$call4->getFunction()]->toArray())186 ->isEqualTo(array(4 => $call4))187 ->object[4]->isIdenticalTo($call4)188 ->if($calls[$newFunction = uniqid()] = $call5 = new adapter\call(uniqid()))189 ->then190 ->array($calls[$newFunction]->toArray())->isEqualTo(array(5 => $call5))191 ->object[5]->isIdenticalTo($call5)192 ->string($call5->getFunction())->isEqualTo($newFunction)193 ;194 }195 public function testOffsetGet()196 {197 $this198 ->if($calls = new testedClass())199 ->then200 ->array($calls[uniqid()]->toArray())->isEmpty()201 ->if($calls[] = $call1 = new adapter\call(uniqid()))202 ->then203 ->array($calls[$call1->getFunction()]->toArray())204 ->isEqualTo(array(1 => $call1))205 ->object[1]->isIdenticalTo($call1)206 ->array($calls[$call1]->toArray())207 ->isEqualTo(array(1 => $call1))208 ->object[1]->isIdenticalTo($call1)209 ->if($calls[] = $call2 = new adapter\call($call1->getFunction(), array()))210 ->then211 ->array($calls[uniqid()]->toArray())->isEmpty()212 ->array($calls[$call1->getFunction()]->toArray())213 ->isEqualTo(array(1 => $call1, 2 => $call2))214 ->object[1]->isIdenticalTo($call1)215 ->object[2]->isIdenticalTo($call2)216 ->array($calls[$call1]->toArray())217 ->isEqualTo(array(1 => $call1, 2 => $call2))218 ->object[1]->isIdenticalTo($call1)219 ->object[2]->isIdenticalTo($call2)220 ->array($calls[$call2->getFunction()]->toArray())221 ->isEqualTo(array(1 => $call1, 2 => $call2))222 ->object[1]->isIdenticalTo($call1)223 ->object[2]->isIdenticalTo($call2)224 ->array($calls[$call2]->toArray())225 ->isEqualTo(array(2 => $call2))226 ->object[2]->isIdenticalTo($call2)227 ;228 }229 public function testOffsetExists()230 {231 $this232 ->if($calls = new testedClass())233 ->then234 ->boolean(isset($calls[uniqid()]))->isFalse()235 ->if($calls[] = $call = new adapter\call(uniqid()))236 ->then237 ->boolean(isset($calls[uniqid()]))->isFalse()238 ->boolean(isset($calls[$call->getFunction()]))->isTrue()239 ->boolean(isset($calls[$call]))->isTrue()240 ;241 }242 public function testOffsetUnset()243 {244 $this245 ->if($calls = new testedClass())246 ->when(function() use ($calls) { unset($calls[uniqid()]); })247 ->then248 ->sizeof($calls)->isZero249 ->if($calls[] = $call = new adapter\call(uniqid()))250 ->when(function() use ($calls) { unset($calls[uniqid()]); })251 ->then252 ->boolean(isset($calls[$call->getFunction()]))->isTrue()253 ->sizeof($calls)->isEqualTo(1)254 ->when(function() use ($calls, $call) { unset($calls[$call->getFunction()]); })255 ->then256 ->boolean(isset($calls[$call->getFunction()]))->isFalse()257 ->sizeof($calls)->isZero258 ;259 }260 public function testGetIterator()261 {262 $this263 ->if($calls = new testedClass())264 ->then265 ->object($calls->getIterator())->isEqualTo(new \arrayIterator($calls()))266 ;267 }268 public function testToArray()269 {270 $this271 ->if($calls = new testedClass())272 ->then273 ->array($calls->toArray())->isEmpty()274 ->array($calls->toArray(new adapter\call(uniqid())))->isEmpty()275 ->if($calls->addCall($call1 = new adapter\call(uniqid())))276 ->then277 ->array($calls->toArray())->isEqualTo(array(1 => $call1))278 ->array($calls->toArray(new adapter\call(uniqid())))->isEmpty()279 ->array($calls->toArray($call1))->isEqualTo(array(1 => $call1))280 ->if($calls->addCall($call2 = clone $call1))281 ->then282 ->array($calls->toArray())->isEqualTo(array(1 => $call1, 2 => $call2))283 ->array($calls->toArray(new adapter\call(uniqid())))->isEmpty()284 ->array($calls->toArray($call1))->isEqualTo(array(1 => $call1, 2 => $call2))285 ->array($calls->toArray($call2))->isEqualTo(array(1 => $call1, 2 => $call2))286 ->if($calls->addCall($call3 = new adapter\call(uniqid())))287 ->then288 ->array($calls->toArray())->isEqualTo(array(1 => $call1, 2 => $call2, 3 => $call3))289 ->array($calls->toArray(new adapter\call(uniqid())))->isEmpty()290 ->array($calls->toArray($call1))->isEqualTo(array(1 => $call1, 2 => $call2))291 ->array($calls->toArray($call2))->isEqualTo(array(1 => $call1, 2 => $call2))292 ->array($calls->toArray($call3))->isEqualTo(array(3 => $call3))293 ;294 }295 public function testGetEqualTo()296 {297 $this298 ->if($calls = new testedClass())299 ->then300 ->object($calls->getEqualTo(new adapter\call(uniqid())))301 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')302 ->hasSize(0)303 ->if($calls[] = $call1 = new adapter\call(uniqid()))304 ->then305 ->object($calls->getEqualTo(new adapter\call(uniqid())))306 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')307 ->hasSize(0)308 ->object($calls->getEqualTo($call1))309 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')310 ->hasSize(1)311 ->array($calls->getEqualTo($call1)->toArray())312 ->isEqualTo(array(1 => $call1))313 ->if($calls[] = $call2 = new adapter\call($call1->getFunction(), array()))314 ->then315 ->object($calls->getEqualTo(new adapter\call(uniqid())))316 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')317 ->hasSize(0)318 ->object($calls->getEqualTo($call1))319 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')320 ->hasSize(2)321 ->array($calls->getEqualTo($call1)->toArray())322 ->isEqualTo(array(1 => $call1, 2 => $call2))323 ->object($calls->getEqualTo($call2))324 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')325 ->hasSize(1)326 ->array($calls->getEqualTo($call2)->toArray())327 ->isEqualTo(array(2 => $call2))328 ->if($calls[] = $call3 = new adapter\call($call1->getFunction(), array($object = new \mock\object())))329 ->then330 ->object($calls->getEqualTo(new adapter\call(uniqid())))331 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')332 ->hasSize(0)333 ->object($calls->getEqualTo($call1))334 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')335 ->hasSize(3)336 ->array($calls->getEqualTo($call1)->toArray())337 ->isEqualTo(array(1 => $call1, 2 => $call2, 3 => $call3))338 ->object($calls->getEqualTo($call2))339 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')340 ->hasSize(1)341 ->array($calls->getEqualTo($call2)->toArray())342 ->isEqualTo(array(2 => $call2))343 ->object($calls->getEqualTo($call3))344 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')345 ->hasSize(1)346 ->array($calls->getEqualTo($call3)->toArray())347 ->isEqualTo(array(3 => $call3))348 ->if($calls[] = $call4 = new adapter\call($call1->getFunction(), array($object = new \mock\object(), $arg = uniqid())))349 ->then350 ->object($calls->getEqualTo(new adapter\call(uniqid())))351 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')352 ->hasSize(0)353 ->object($calls->getEqualTo($call1))354 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')355 ->hasSize(4)356 ->array($calls->getEqualTo($call1)->toArray())357 ->isEqualTo(array(1 => $call1, 2 => $call2, 3 => $call3, 4 => $call4))358 ->object($calls->getEqualTo($call2))359 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')360 ->hasSize(1)361 ->array($calls->getEqualTo($call2)->toArray())362 ->isEqualTo(array(2 => $call2))363 ->object($calls->getEqualTo($call3))364 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')365 ->hasSize(2)366 ->array($calls->getEqualTo($call3)->toArray())367 ->isEqualTo(array(3 => $call3, 4 => $call4))368 ->object($calls->getEqualTo(new adapter\call($call1->getFunction(), array(clone $object))))369 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')370 ->hasSize(2)371 ->array($calls->getEqualTo($call3)->toArray())372 ->isEqualTo(array(3 => $call3, 4 => $call4))373 ->object($calls->getEqualTo($call4))374 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')375 ->hasSize(1)376 ->array($calls->getEqualTo($call4)->toArray())377 ->isEqualTo(array(4 => $call4))378 ->object($calls->getEqualTo(new adapter\call($call1->getFunction(), array(clone $object, $arg))))379 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')380 ->hasSize(1)381 ->array($calls->getEqualTo($call4)->toArray())382 ->isEqualTo(array(4 => $call4))383 ->if($calls = new testedClass())384 ->and($calls[] = $call5 = new adapter\call(uniqid(), array(1, 2, 3, 4, 5)))385 ->then386 ->object($calls->getEqualTo(new adapter\call($call5->getFunction())))387 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')388 ->hasSize(1)389 ->array($calls->getEqualTo(new adapter\call($call5->getFunction()))->toArray())390 ->isEqualTo(array(5 => $call5))391 ;392 }393 public function testGetIdenticalTo()394 {395 $this396 ->if($calls = new testedClass())397 ->then398 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))399 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')400 ->hasSize(0)401 ->if($calls[] = $call1 = new adapter\call(uniqid()))402 ->then403 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))404 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')405 ->hasSize(0)406 ->object($calls->getIdenticalTo($call1))407 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')408 ->hasSize(1)409 ->array($calls->getIdenticalTo($call1)->toArray())410 ->isEqualTo(array(1 => $call1))411 ->if($calls[] = $call2 = new adapter\call($call1->getFunction(), array()))412 ->then413 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))414 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')415 ->hasSize(0)416 ->object($calls->getIdenticalTo($call1))417 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')418 ->hasSize(2)419 ->array($calls->getIdenticalTo($call1)->toArray())420 ->isEqualTo(array(1 => $call1, 2 => $call2))421 ->object($calls->getIdenticalTo($call2))422 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')423 ->hasSize(1)424 ->array($calls->getIdenticalTo($call2)->toArray())425 ->isEqualTo(array(2 => $call2))426 ->if($calls[] = $call3 = new adapter\call($call1->getFunction(), array($object = new \mock\object())))427 ->then428 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))429 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')430 ->hasSize(0)431 ->object($calls->getIdenticalTo($call1))432 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')433 ->hasSize(3)434 ->array($calls->getIdenticalTo($call1)->toArray())435 ->isEqualTo(array(1 => $call1, 2 => $call2, 3 => $call3))436 ->object($calls->getIdenticalTo($call2))437 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')438 ->hasSize(1)439 ->array($calls->getIdenticalTo($call2)->toArray())440 ->isEqualTo(array(2 => $call2))441 ->object($calls->getIdenticalTo($call3))442 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')443 ->hasSize(1)444 ->array($calls->getIdenticalTo($call3)->toArray())445 ->isEqualTo(array(3 => $call3))446 ->object($calls->getIdenticalTo(new adapter\call($call1->getFunction(), array(clone $object))))447 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')448 ->hasSize(0)449 ->if($calls[] = $call4 = new adapter\call($call1->getFunction(), array($object = new \mock\object(), $arg = uniqid())))450 ->then451 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))452 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')453 ->hasSize(0)454 ->object($calls->getIdenticalTo($call1))455 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')456 ->hasSize(4)457 ->array($calls->getIdenticalTo($call1)->toArray())458 ->isEqualTo(array(1 => $call1, 2 => $call2, 3 => $call3, 4 => $call4))459 ->object($calls->getIdenticalTo($call2))460 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')461 ->hasSize(1)462 ->array($calls->getIdenticalTo($call2)->toArray())463 ->isEqualTo(array(2 => $call2))464 ->object($calls->getIdenticalTo($call3))465 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')466 ->hasSize(1)467 ->array($calls->getIdenticalTo($call3)->toArray())468 ->isEqualTo(array(3 => $call3))469 ->object($calls->getIdenticalTo(new adapter\call($call1->getFunction(), array(clone $object))))470 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')471 ->hasSize(0)472 ->object($calls->getIdenticalTo($call4))473 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')474 ->hasSize(1)475 ->array($calls->getIdenticalTo($call4)->toArray())476 ->isEqualTo(array(4 => $call4))477 ->object($calls->getIdenticalTo(new adapter\call($call1->getFunction(), array(clone $object, $arg))))478 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')479 ->hasSize(0)480 ;481 }482 public function testGetPreviousEqualTo()483 {484 $this485 ->if($calls = new testedClass())486 ->then487 ->object($calls->getPreviousEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))488 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')489 ->hasSize(0)490 ->if($calls[] = $call1 = new adapter\call(uniqid()))491 ->then492 ->object($calls->getPreviousEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))493 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')494 ->hasSize(0)495 ->object($calls->getPreviousEqualTo(new adapter\call($call1), 0))496 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')497 ->hasSize(0)498 ->object($calls->getPreviousEqualTo(new adapter\call($call1), 1))499 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')500 ->hasSize(0)501 ->object($calls->getPreviousEqualTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))502 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')503 ->hasSize(0)504 ->if($calls[] = $call2 = new adapter\call(uniqid(), array()))505 ->then506 ->object($calls->getPreviousEqualTo(new adapter\call(uniqid()), 1))507 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')508 ->hasSize(0)509 ->object($calls->getPreviousEqualTo($call1, 1))510 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')511 ->hasSize(0)512 ->object($previousCalls = $calls->getPreviousEqualTo($call1, 2))513 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')514 ->hasSize(1)515 ->array($previousCalls->toArray())516 ->isEqualTo(array(1 => $call1))517 ->object($calls->getPreviousEqualTo($call2, 1))518 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')519 ->hasSize(0)520 ->object($calls->getPreviousEqualTo($call2, 2))521 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')522 ->hasSize(0)523 ->if($calls[] = $call3 = new adapter\call(uniqid(), array($object = new \mock\object())))524 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), array(clone $object)))525 ->and($calls[] = $call5 = new adapter\call(uniqid(), array()))526 ->then527 ->object($calls->getPreviousEqualTo(new adapter\call(uniqid()), 1))528 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')529 ->hasSize(0)530 ->object($calls->getPreviousEqualTo($call1, 1))531 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')532 ->hasSize(0)533 ->object($previousCalls = $calls->getPreviousEqualTo($call1, 2))534 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')535 ->hasSize(1)536 ->array($previousCalls->toArray())537 ->isEqualTo(array(1 => $call1))538 ->object($calls->getPreviousEqualTo($call2, 1))539 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')540 ->hasSize(0)541 ->object($calls->getPreviousEqualTo($call2, 2))542 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')543 ->hasSize(0)544 ->object($previousCalls = $calls->getPreviousEqualTo($call3, 4))545 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')546 ->hasSize(1)547 ->array($previousCalls->toArray())548 ->isEqualTo(array(3 => $call3))549 ->object($previousCalls = $calls->getPreviousEqualTo($call4, 4))550 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')551 ->hasSize(1)552 ->array($previousCalls->toArray())553 ->isEqualTo(array(3 => $call3))554 ->object($previousCalls = $calls->getPreviousEqualTo($call3, 5))555 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')556 ->hasSize(2)557 ->array($previousCalls->toArray())558 ->isEqualTo(array(3 => $call3, 4 => $call4))559 ->object($previousCalls = $calls->getPreviousEqualTo($call4, 5))560 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')561 ->hasSize(2)562 ->array($previousCalls->toArray())563 ->isEqualTo(array(3 => $call3, 4 => $call4))564 ;565 }566 public function testGetPreviousIdenticalTo()567 {568 $this569 ->if($calls = new testedClass())570 ->then571 ->object($calls->getPreviousIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))572 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')573 ->hasSize(0)574 ->if($calls[] = $call1 = new adapter\call(uniqid()))575 ->then576 ->object($calls->getPreviousIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))577 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')578 ->hasSize(0)579 ->object($calls->getPreviousIdenticalTo(new adapter\call($call1), 0))580 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')581 ->hasSize(0)582 ->object($calls->getPreviousIdenticalTo(new adapter\call($call1), 1))583 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')584 ->hasSize(0)585 ->object($calls->getPreviousIdenticalTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))586 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')587 ->hasSize(0)588 ->if($calls[] = $call2 = new adapter\call(uniqid(), array()))589 ->then590 ->object($calls->getPreviousIdenticalTo(new adapter\call(uniqid()), 1))591 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')592 ->hasSize(0)593 ->object($calls->getPreviousIdenticalTo($call1, 1))594 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')595 ->hasSize(0)596 ->object($previousCalls = $calls->getPreviousIdenticalTo($call1, 2))597 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')598 ->hasSize(1)599 ->array($previousCalls->toArray())600 ->isIdenticalTo(array(1 => $call1))601 ->object($calls->getPreviousIdenticalTo($call2, 1))602 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')603 ->hasSize(0)604 ->object($calls->getPreviousIdenticalTo($call2, 2))605 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')606 ->hasSize(0)607 ->if($calls[] = $call3 = new adapter\call(uniqid(), array($object = new \mock\object())))608 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), array(clone $object)))609 ->and($calls[] = $call5 = new adapter\call(uniqid(), array()))610 ->then611 ->object($calls->getPreviousIdenticalTo(new adapter\call(uniqid()), 1))612 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')613 ->hasSize(0)614 ->object($calls->getPreviousIdenticalTo($call1, 1))615 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')616 ->hasSize(0)617 ->object($previousCalls = $calls->getPreviousIdenticalTo($call1, 2))618 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')619 ->hasSize(1)620 ->array($previousCalls->toArray())621 ->isIdenticalTo(array(1 => $call1))622 ->object($calls->getPreviousIdenticalTo($call2, 1))623 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')624 ->hasSize(0)625 ->object($calls->getPreviousIdenticalTo($call2, 2))626 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')627 ->hasSize(0)628 ->object($previousCalls = $calls->getPreviousIdenticalTo($call3, 4))629 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')630 ->hasSize(1)631 ->array($previousCalls->toArray())632 ->isIdenticalTo(array(3 => $call3))633 ->object($calls->getPreviousIdenticalTo($call4, 4))634 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')635 ->hasSize(0)636 ->object($previousCalls = $calls->getPreviousIdenticalTo($call3, 5))637 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')638 ->hasSize(1)639 ->array($previousCalls->toArray())640 ->isIdenticalTo(array(3 => $call3))641 ->object($previousCalls =$calls->getPreviousIdenticalTo($call4, 5))642 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')643 ->hasSize(1)644 ->array($previousCalls->toArray())645 ->isIdenticalTo(array(4 => $call4))646 ;647 }648 public function testGetPrevious()649 {650 $this651 ->if($calls = new mockedTestedClass())652 ->then653 ->object($calls->getPrevious($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX)))654 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')655 ->mock($calls)->call('getPreviousEqualTo')->withArguments($call, $position)->once()656 ->object($calls->getPrevious($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX), true))657 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')658 ->mock($calls)->call('getPreviousIdenticalTo')->withArguments($call, $position)->once()659 ;660 }661 public function testHasPreviousEqualTo()662 {663 $this664 ->if($calls = new testedClass())665 ->then666 ->boolean($calls->hasPreviousEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()667 ->if($calls[] = $call1 = new adapter\call(uniqid()))668 ->then669 ->boolean($calls->hasPreviousEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()670 ->boolean($calls->hasPreviousEqualTo(new adapter\call($call1), 0))->isFalse()671 ->boolean($calls->hasPreviousEqualTo(new adapter\call($call1), 1))->isFalse()672 ->boolean($calls->hasPreviousEqualTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))->isFalse()673 ->if($calls[] = $call2 = new adapter\call(uniqid(), array()))674 ->then675 ->boolean($calls->hasPreviousEqualTo(new adapter\call(uniqid()), 1))->isFalse()676 ->boolean($calls->hasPreviousEqualTo($call1, 1))->isFalse()677 ->boolean($previousCalls = $calls->hasPreviousEqualTo($call1, 2))->isTrue()678 ->boolean($calls->hasPreviousEqualTo($call2, 1))->isFalse()679 ->boolean($calls->hasPreviousEqualTo($call2, 2))->isFalse()680 ->if($calls[] = $call3 = new adapter\call(uniqid(), array($object = new \mock\object())))681 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), array(clone $object)))682 ->and($calls[] = $call5 = new adapter\call(uniqid(), array()))683 ->then684 ->boolean($calls->hasPreviousEqualTo(new adapter\call(uniqid()), 1))->isFalse()685 ->boolean($calls->hasPreviousEqualTo($call1, 1))->isFalse()686 ->boolean($previousCalls = $calls->hasPreviousEqualTo($call1, 2))->isTrue()687 ->boolean($calls->hasPreviousEqualTo($call2, 1))->isFalse()688 ->boolean($calls->hasPreviousEqualTo($call2, 2))->isFalse()689 ->boolean($previousCalls = $calls->hasPreviousEqualTo($call3, 4))->isTrue()690 ->boolean($previousCalls = $calls->hasPreviousEqualTo($call4, 4))->isTrue()691 ->boolean($previousCalls = $calls->hasPreviousEqualTo($call3, 5))->isTrue()692 ->boolean($previousCalls = $calls->hasPreviousEqualTo($call4, 5))->isTrue()693 ;694 }695 public function testHasPreviousIdenticalTo()696 {697 $this698 ->if($calls = new testedClass())699 ->then700 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()701 ->if($calls[] = $call1 = new adapter\call(uniqid()))702 ->then703 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()704 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call($call1), 0))->isFalse()705 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call($call1), 1))->isFalse()706 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))->isFalse()707 ->if($calls[] = $call2 = new adapter\call(uniqid(), array()))708 ->then709 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call(uniqid()), 1))->isFalse()710 ->boolean($calls->hasPreviousIdenticalTo($call1, 1))->isFalse()711 ->boolean($previousCalls = $calls->hasPreviousIdenticalTo($call1, 2))->isTrue()712 ->boolean($calls->hasPreviousIdenticalTo($call2, 1))->isFalse()713 ->boolean($calls->hasPreviousIdenticalTo($call2, 2))->isFalse()714 ->if($calls[] = $call3 = new adapter\call(uniqid(), array($object = new \mock\object())))715 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), array(clone $object)))716 ->and($calls[] = $call5 = new adapter\call(uniqid(), array()))717 ->then718 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call(uniqid()), 1))->isFalse()719 ->boolean($calls->hasPreviousIdenticalTo($call1, 1))->isFalse()720 ->boolean($previousCalls = $calls->hasPreviousIdenticalTo($call1, 2))->isTrue()721 ->boolean($calls->hasPreviousIdenticalTo($call2, 1))->isFalse()722 ->boolean($calls->hasPreviousIdenticalTo($call2, 2))->isFalse()723 ->boolean($previousCalls = $calls->hasPreviousIdenticalTo($call3, 4))->isTrue()724 ->boolean($calls->hasPreviousIdenticalTo($call4, 4))->isFalse()725 ->boolean($previousCalls = $calls->hasPreviousIdenticalTo($call3, 5))->isTrue()726 ->boolean($previousCalls =$calls->hasPreviousIdenticalTo($call4, 5))->isTrue()727 ;728 }729 public function testHasPrevious()730 {731 $this732 ->if($calls = new mockedTestedClass())733 ->then734 ->boolean($calls->hasPrevious($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX)))->isFalse()735 ->mock($calls)->call('hasPreviousEqualTo')->withArguments($call, $position)->once()736 ->boolean($calls->hasPrevious($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX), true))->isFalse()737 ->mock($calls)->call('hasPreviousIdenticalTo')->withArguments($call, $position)->once()738 ;739 }740 public function testGetAfterEqualTo()741 {742 $this743 ->if($calls = new testedClass())744 ->then745 ->object($calls->getAfterEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))746 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')747 ->hasSize(0)748 ->if($calls[] = $call1 = new adapter\call(uniqid()))749 ->then750 ->object($calls->getAfterEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))751 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')752 ->hasSize(0)753 ->object($calls->getAfterEqualTo(new adapter\call($call1), 0))754 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')755 ->hasSize(0)756 ->object($calls->getAfterEqualTo(new adapter\call($call1), 1))757 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')758 ->hasSize(0)759 ->object($calls->getAfterEqualTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))760 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')761 ->hasSize(0)762 ->if($calls[] = $call2 = new adapter\call(uniqid(), array()))763 ->then764 ->object($calls->getAfterEqualTo(new adapter\call(uniqid()), 1))765 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')766 ->hasSize(0)767 ->object($calls->getAfterEqualTo($call1, 1))768 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')769 ->hasSize(0)770 ->object($calls->getAfterEqualTo($call1, 2))771 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')772 ->hasSize(0)773 ->object($afterCalls = $calls->getAfterEqualTo($call2, 1))774 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')775 ->hasSize(1)776 ->array($afterCalls->toArray())777 ->isEqualTo(array(2 => $call2))778 ->object($calls->getAfterEqualTo($call2, 2))779 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')780 ->hasSize(0)781 ->if($calls[] = $call3 = new adapter\call(uniqid(), array($object = new \mock\object())))782 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), array(clone $object)))783 ->and($calls[] = $call5 = new adapter\call(uniqid(), array()))784 ->then785 ->object($calls->getAfterEqualTo(new adapter\call(uniqid()), 1))786 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')787 ->hasSize(0)788 ->object($calls->getAfterEqualTo($call1, 1))789 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')790 ->hasSize(0)791 ->object($calls->getAfterEqualTo($call1, 2))792 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')793 ->hasSize(0)794 ->object($afterCalls = $calls->getAfterEqualTo($call2, 1))795 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')796 ->hasSize(1)797 ->array($afterCalls->toArray())798 ->isEqualTo(array(2 => $call2))799 ->object($calls->getAfterEqualTo($call2, 2))800 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')801 ->hasSize(0)802 ->object($afterCalls = $calls->getAfterEqualTo($call3, 1))803 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')804 ->hasSize(2)805 ->array($afterCalls->toArray())806 ->isEqualTo(array(3 => $call3, 4 => $call4))807 ->object($afterCalls = $calls->getAfterEqualTo($call3, 3))808 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')809 ->hasSize(1)810 ->array($afterCalls->toArray())811 ->isEqualTo(array(4 => $call4))812 ->object($afterCalls = $calls->getAfterEqualTo($call4, 1))813 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')814 ->hasSize(2)815 ->array($afterCalls->toArray())816 ->isEqualTo(array(3 => $call3, 4 => $call4))817 ;818 }819 public function testGetAfterIdenticalTo()820 {821 $this822 ->if($calls = new testedClass())823 ->then824 ->object($calls->getAfterIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))825 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')826 ->hasSize(0)827 ->if($calls[] = $call1 = new adapter\call(uniqid()))828 ->then829 ->object($calls->getAfterIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))830 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')831 ->hasSize(0)832 ->object($calls->getAfterIdenticalTo(new adapter\call($call1), 0))833 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')834 ->hasSize(0)835 ->object($calls->getAfterIdenticalTo(new adapter\call($call1), 1))836 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')837 ->hasSize(0)838 ->object($calls->getAfterIdenticalTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))839 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')840 ->hasSize(0)841 ->if($calls[] = $call2 = new adapter\call(uniqid(), array()))842 ->then843 ->object($calls->getAfterIdenticalTo(new adapter\call(uniqid()), 1))844 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')845 ->hasSize(0)846 ->object($calls->getAfterIdenticalTo($call1, 1))847 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')848 ->hasSize(0)849 ->object($calls->getAfterIdenticalTo($call1, 2))850 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')851 ->hasSize(0)852 ->object($afterCalls = $calls->getAfterIdenticalTo($call2, 1))853 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')854 ->hasSize(1)855 ->array($afterCalls->toArray())856 ->isIdenticalTo(array(2 => $call2))857 ->object($calls->getAfterIdenticalTo($call2, 2))858 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')859 ->hasSize(0)860 ->if($calls[] = $call3 = new adapter\call(uniqid(), array($object = new \mock\object())))861 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), array(clone $object)))862 ->and($calls[] = $call5 = new adapter\call(uniqid(), array()))863 ->then864 ->object($calls->getAfterIdenticalTo(new adapter\call(uniqid()), 1))865 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')866 ->hasSize(0)867 ->object($calls->getAfterIdenticalTo($call1, 1))868 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')869 ->hasSize(0)870 ->object($calls->getAfterIdenticalTo($call1, 2))871 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')872 ->hasSize(0)873 ->object($afterCalls = $calls->getAfterIdenticalTo($call2, 1))874 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')875 ->hasSize(1)876 ->array($afterCalls->toArray())877 ->isIdenticalTo(array(2 => $call2))878 ->object($calls->getAfterIdenticalTo($call2, 2))879 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')880 ->hasSize(0)881 ->object($afterCalls = $calls->getAfterIdenticalTo($call3, 1))882 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')883 ->hasSize(1)884 ->array($afterCalls->toArray())885 ->isIdenticalTo(array(3 => $call3))886 ->object($afterCalls = $calls->getAfterIdenticalTo($call3, 3))887 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')888 ->hasSize(0)889 ->object($afterCalls = $calls->getAfterIdenticalTo($call4, 1))890 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')891 ->hasSize(1)892 ->array($afterCalls->toArray())893 ->isIdenticalTo(array(4 => $call4))894 ;895 }896 public function testGetAfter()897 {898 $this899 ->if($calls = new mockedTestedClass())900 ->then901 ->object($calls->getAfter($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX)))902 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')903 ->mock($calls)->call('getAfterEqualTo')->withArguments($call, $position)->once()904 ->object($calls->getAfter($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX), true))905 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')906 ->mock($calls)->call('getAfterIdenticalTo')->withArguments($call, $position)->once()907 ;908 }909 public function testHasAfterEqualTo()910 {911 $this912 ->if($calls = new testedClass())913 ->then914 ->boolean($calls->hasAfterEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()915 ->if($calls[] = $call1 = new adapter\call(uniqid()))916 ->then917 ->boolean($calls->hasAfterEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()918 ->boolean($calls->hasAfterEqualTo(new adapter\call($call1), 0))->isFalse()919 ->boolean($calls->hasAfterEqualTo(new adapter\call($call1), 1))->isFalse()920 ->boolean($calls->hasAfterEqualTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))->isFalse()921 ->if($calls[] = $call2 = new adapter\call(uniqid(), array()))922 ->then923 ->boolean($calls->hasAfterEqualTo(new adapter\call(uniqid()), 1))->isFalse()924 ->boolean($calls->hasAfterEqualTo($call1, 1))->isFalse()925 ->boolean($calls->hasAfterEqualTo($call1, 2))->isFalse()926 ->boolean($afterCalls = $calls->hasAfterEqualTo($call2, 1))->isTrue()927 ->boolean($calls->hasAfterEqualTo($call2, 2))->isFalse()928 ->if($calls[] = $call3 = new adapter\call(uniqid(), array($object = new \mock\object())))929 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), array(clone $object)))930 ->and($calls[] = $call5 = new adapter\call(uniqid(), array()))931 ->then932 ->boolean($calls->hasAfterEqualTo(new adapter\call(uniqid()), 1))->isFalse()933 ->boolean($calls->hasAfterEqualTo($call1, 1))->isFalse()934 ->boolean($calls->hasAfterEqualTo($call1, 2))->isFalse()935 ->boolean($afterCalls = $calls->hasAfterEqualTo($call2, 1))->isTrue()936 ->boolean($calls->hasAfterEqualTo($call2, 2))->isFalse()937 ->boolean($afterCalls = $calls->hasAfterEqualTo($call3, 1))->isTrue()938 ->boolean($afterCalls = $calls->hasAfterEqualTo($call3, 3))->isTrue()939 ->boolean($afterCalls = $calls->hasAfterEqualTo($call4, 1))->isTrue()940 ;941 }942 public function testHasAfterIdenticalTo()943 {944 $this945 ->if($calls = new testedClass())946 ->then947 ->boolean($calls->hasAfterIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()948 ->if($calls[] = $call1 = new adapter\call(uniqid()))949 ->then950 ->boolean($calls->hasAfterIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()951 ->boolean($calls->hasAfterIdenticalTo(new adapter\call($call1), 0))->isFalse()952 ->boolean($calls->hasAfterIdenticalTo(new adapter\call($call1), 1))->isFalse()953 ->boolean($calls->hasAfterIdenticalTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))->isFalse()954 ->if($calls[] = $call2 = new adapter\call(uniqid(), array()))955 ->then956 ->boolean($calls->hasAfterIdenticalTo(new adapter\call(uniqid()), 1))->isFalse()957 ->boolean($calls->hasAfterIdenticalTo($call1, 1))->isFalse()958 ->boolean($calls->hasAfterIdenticalTo($call1, 2))->isFalse()959 ->boolean($afterCalls = $calls->hasAfterIdenticalTo($call2, 1))->isTrue()960 ->boolean($calls->hasAfterIdenticalTo($call2, 2))->isFalse()961 ->if($calls[] = $call3 = new adapter\call(uniqid(), array($object = new \mock\object())))962 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), array(clone $object)))963 ->and($calls[] = $call5 = new adapter\call(uniqid(), array()))964 ->then965 ->boolean($calls->hasAfterIdenticalTo(new adapter\call(uniqid()), 1))->isFalse()966 ->boolean($calls->hasAfterIdenticalTo($call1, 1))->isFalse()967 ->boolean($calls->hasAfterIdenticalTo($call1, 2))->isFalse()968 ->boolean($afterCalls = $calls->hasAfterIdenticalTo($call2, 1))->isTrue()969 ->boolean($calls->hasAfterIdenticalTo($call2, 2))->isFalse()970 ->boolean($afterCalls = $calls->hasAfterIdenticalTo($call3, 1))->isTrue()971 ->boolean($afterCalls = $calls->hasAfterIdenticalTo($call3, 3))->isFalse()972 ->boolean($afterCalls = $calls->hasAfterIdenticalTo($call4, 1))->isTrue()973 ;974 }975 public function testHasAfter()976 {977 $this978 ->if($calls = new mockedTestedClass())979 ->then980 ->boolean($calls->hasAfter($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX)))->isFalse()981 ->mock($calls)->call('hasAfterEqualTo')->withArguments($call, $position)->once()982 ->boolean($calls->hasAfter($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX), true))->isFalse()983 ->mock($calls)->call('hasAfterIdenticalTo')->withArguments($call, $position)->once()984 ;985 }986 public function testGet()987 {988 $this989 ->if($calls = new testedClass())990 ->then991 ->object($calls->get(new adapter\call(uniqid())))992 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')993 ->hasSize(0)994 ->if($calls[] = $call1 = new adapter\call(uniqid()))995 ->then996 ->object($calls->get(new adapter\call(uniqid())))997 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')998 ->hasSize(0)999 ->object($calls->get($call1))1000 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1001 ->hasSize(1)1002 ->array($calls->get($call1)->toArray())1003 ->isEqualTo(array(1 => $call1))1004 ->if($calls[] = $call2 = new adapter\call($call1->getFunction(), array()))1005 ->then1006 ->object($calls->get(new adapter\call(uniqid())))1007 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1008 ->hasSize(0)1009 ->object($calls->get($call1))1010 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1011 ->hasSize(2)1012 ->array($calls->get($call1)->toArray())1013 ->isEqualTo(array(1 => $call1, 2 => $call2))1014 ->object($calls->get($call2))1015 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1016 ->hasSize(1)1017 ->array($calls->get($call2)->toArray())1018 ->isEqualTo(array(2 => $call2))1019 ->if($calls[] = $call3 = new adapter\call($call1->getFunction(), array($object = new \mock\object())))1020 ->then1021 ->object($calls->get(new adapter\call(uniqid())))1022 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1023 ->hasSize(0)1024 ->object($calls->get($call1))1025 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1026 ->hasSize(3)1027 ->array($calls->get($call1)->toArray())1028 ->isEqualTo(array(1 => $call1, 2 => $call2, 3 => $call3))1029 ->object($calls->get($call2))1030 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1031 ->hasSize(1)1032 ->array($calls->get($call2)->toArray())1033 ->isEqualTo(array(2 => $call2))1034 ->object($calls->get($call3))1035 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1036 ->hasSize(1)1037 ->array($calls->get($call3)->toArray())1038 ->isEqualTo(array(3 => $call3))1039 ->if($calls[] = $call4 = new adapter\call($call1->getFunction(), array($object = new \mock\object(), $arg = uniqid())))1040 ->then1041 ->object($calls->get(new adapter\call(uniqid())))1042 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1043 ->hasSize(0)1044 ->object($calls->get($call1))1045 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1046 ->hasSize(4)1047 ->array($calls->get($call1)->toArray())1048 ->isEqualTo(array(1 => $call1, 2 => $call2, 3 => $call3, 4 => $call4))1049 ->object($calls->get($call2))1050 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1051 ->hasSize(1)1052 ->array($calls->get($call2)->toArray())1053 ->isEqualTo(array(2 => $call2))1054 ->object($calls->get($call3))1055 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1056 ->hasSize(2)1057 ->array($calls->get($call3)->toArray())1058 ->isEqualTo(array(3 => $call3, 4 => $call4))1059 ->object($calls->get(new adapter\call($call1->getFunction(), array(clone $object))))1060 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1061 ->hasSize(2)1062 ->array($calls->get($call3)->toArray())1063 ->isEqualTo(array(3 => $call3, 4 => $call4))1064 ->object($calls->get($call4))1065 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1066 ->hasSize(1)1067 ->array($calls->get($call4)->toArray())1068 ->isEqualTo(array(4 => $call4))1069 ->object($calls->get(new adapter\call($call1->getFunction(), array(clone $object, $arg))))1070 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1071 ->hasSize(1)1072 ->array($calls->get($call4)->toArray())1073 ->isEqualTo(array(4 => $call4))1074 ->if($calls = new testedClass())1075 ->then1076 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))1077 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1078 ->hasSize(0)1079 ->if($calls[] = $call5 = new adapter\call(uniqid()))1080 ->then1081 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))1082 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1083 ->hasSize(0)1084 ->object($calls->getIdenticalTo($call5))1085 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1086 ->hasSize(1)1087 ->array($calls->getIdenticalTo($call5)->toArray())1088 ->isEqualTo(array(5 => $call5))1089 ->if($calls[] = $call6 = new adapter\call($call5->getFunction(), array()))1090 ->then1091 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))1092 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1093 ->hasSize(0)1094 ->object($calls->getIdenticalTo($call5))1095 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1096 ->hasSize(2)1097 ->array($calls->getIdenticalTo($call5)->toArray())1098 ->isEqualTo(array(5 => $call5, 6 => $call6))1099 ->object($calls->getIdenticalTo($call6))1100 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1101 ->hasSize(1)1102 ->array($calls->getIdenticalTo($call6)->toArray())1103 ->isEqualTo(array(6 => $call6))1104 ->if($calls[] = $call7 = new adapter\call($call5->getFunction(), array($object = new \mock\object())))1105 ->then1106 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))1107 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1108 ->hasSize(0)1109 ->object($calls->getIdenticalTo($call5))1110 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1111 ->hasSize(3)1112 ->array($calls->getIdenticalTo($call5)->toArray())1113 ->isEqualTo(array(5 => $call5, 6 => $call6, 7 => $call7))1114 ->object($calls->getIdenticalTo($call6))1115 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1116 ->hasSize(1)1117 ->array($calls->getIdenticalTo($call6)->toArray())1118 ->isEqualTo(array(6 => $call6))1119 ->object($calls->getIdenticalTo($call7))1120 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1121 ->hasSize(1)1122 ->array($calls->getIdenticalTo($call7)->toArray())1123 ->isEqualTo(array(7 => $call7))1124 ->object($calls->getIdenticalTo(new adapter\call($call5->getFunction(), array(clone $object))))1125 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1126 ->hasSize(0)1127 ->if($calls[] = $call8 = new adapter\call($call5->getFunction(), array($object = new \mock\object(), $arg = uniqid())))1128 ->then1129 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))1130 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1131 ->hasSize(0)1132 ->object($calls->getIdenticalTo($call5))1133 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1134 ->hasSize(4)1135 ->array($calls->getIdenticalTo($call5)->toArray())1136 ->isEqualTo(array(5 => $call5, 6 => $call6, 7 => $call7, 8 => $call8))1137 ->object($calls->getIdenticalTo($call6))1138 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1139 ->hasSize(1)1140 ->array($calls->getIdenticalTo($call6)->toArray())1141 ->isEqualTo(array(6 => $call6))1142 ->object($calls->getIdenticalTo($call7))1143 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1144 ->hasSize(1)1145 ->array($calls->getIdenticalTo($call7)->toArray())1146 ->isEqualTo(array(7 => $call7))1147 ->object($calls->getIdenticalTo(new adapter\call($call5->getFunction(), array(clone $object))))1148 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1149 ->hasSize(0)1150 ->object($calls->getIdenticalTo($call8))1151 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1152 ->hasSize(1)1153 ->array($calls->getIdenticalTo($call8)->toArray())1154 ->isEqualTo(array(8 => $call8))1155 ->object($calls->getIdenticalTo(new adapter\call($call1->getFunction(), array(clone $object, $arg))))1156 ->isInstanceOf('mageekguy\atoum\test\adapter\calls')1157 ->hasSize(0)1158 ;1159 }1160 public function testGetTimeline()1161 {1162 $this1163 ->if($calls = new testedClass())1164 ->then1165 ->array($calls->getTimeline())->isEmpty()1166 ->if($calls[] = $call1 = new adapter\call(uniqid()))1167 ->then1168 ->array($calls->getTimeline())->isEqualTo(array(1 => $call1))1169 ->if($calls[] = $call2 = new adapter\call(uniqid()))1170 ->then1171 ->array($calls->getTimeline())->isEqualTo(array(1172 1 => $call1,1173 2 => $call21174 )1175 )1176 ->if($otherCalls = new testedClass())1177 ->and($otherCalls[] = $call3 = new adapter\call(uniqid()))1178 ->then1179 ->array($calls->getTimeline())->isEqualTo(array(1180 1 => $call1,1181 2 => $call21182 )1183 )1184 ->if($calls[] = $call4 = new adapter\call(uniqid()))1185 ->then1186 ->array($calls->getTimeline())->isEqualTo(array(1187 1 => $call1,1188 2 => $call2,1189 4 => $call41190 )1191 )1192 ;1193 }1194}...

Full Screen

Full Screen

TraceableAdapterTest.php

Source:TraceableAdapterTest.php Github

copy

Full Screen

...25 public function testGetItemMissTrace()26 {27 $pool = $this->createCachePool();28 $pool->getItem('k');29 $calls = $pool->getCalls();30 $this->assertCount(1, $calls);31 $call = $calls[0];32 $this->assertSame('getItem', $call->name);33 $this->assertSame(['k' => false], $call->result);34 $this->assertSame(0, $call->hits);35 $this->assertSame(1, $call->misses);36 $this->assertNotEmpty($call->start);37 $this->assertNotEmpty($call->end);38 }39 public function testGetItemHitTrace()40 {41 $pool = $this->createCachePool();42 $item = $pool->getItem('k')->set('foo');43 $pool->save($item);44 $pool->getItem('k');45 $calls = $pool->getCalls();46 $this->assertCount(3, $calls);47 $call = $calls[2];48 $this->assertSame(1, $call->hits);49 $this->assertSame(0, $call->misses);50 }51 public function testGetItemsMissTrace()52 {53 $pool = $this->createCachePool();54 $arg = ['k0', 'k1'];55 $items = $pool->getItems($arg);56 foreach ($items as $item) {57 }58 $calls = $pool->getCalls();59 $this->assertCount(1, $calls);60 $call = $calls[0];61 $this->assertSame('getItems', $call->name);62 $this->assertSame(['k0' => false, 'k1' => false], $call->result);63 $this->assertSame(2, $call->misses);64 $this->assertNotEmpty($call->start);65 $this->assertNotEmpty($call->end);66 }67 public function testHasItemMissTrace()68 {69 $pool = $this->createCachePool();70 $pool->hasItem('k');71 $calls = $pool->getCalls();72 $this->assertCount(1, $calls);73 $call = $calls[0];74 $this->assertSame('hasItem', $call->name);75 $this->assertSame(['k' => false], $call->result);76 $this->assertNotEmpty($call->start);77 $this->assertNotEmpty($call->end);78 }79 public function testHasItemHitTrace()80 {81 $pool = $this->createCachePool();82 $item = $pool->getItem('k')->set('foo');83 $pool->save($item);84 $pool->hasItem('k');85 $calls = $pool->getCalls();86 $this->assertCount(3, $calls);87 $call = $calls[2];88 $this->assertSame('hasItem', $call->name);89 $this->assertSame(['k' => true], $call->result);90 $this->assertNotEmpty($call->start);91 $this->assertNotEmpty($call->end);92 }93 public function testDeleteItemTrace()94 {95 $pool = $this->createCachePool();96 $pool->deleteItem('k');97 $calls = $pool->getCalls();98 $this->assertCount(1, $calls);99 $call = $calls[0];100 $this->assertSame('deleteItem', $call->name);101 $this->assertSame(['k' => true], $call->result);102 $this->assertSame(0, $call->hits);103 $this->assertSame(0, $call->misses);104 $this->assertNotEmpty($call->start);105 $this->assertNotEmpty($call->end);106 }107 public function testDeleteItemsTrace()108 {109 $pool = $this->createCachePool();110 $arg = ['k0', 'k1'];111 $pool->deleteItems($arg);112 $calls = $pool->getCalls();113 $this->assertCount(1, $calls);114 $call = $calls[0];115 $this->assertSame('deleteItems', $call->name);116 $this->assertSame(['keys' => $arg, 'result' => true], $call->result);117 $this->assertSame(0, $call->hits);118 $this->assertSame(0, $call->misses);119 $this->assertNotEmpty($call->start);120 $this->assertNotEmpty($call->end);121 }122 public function testSaveTrace()123 {124 $pool = $this->createCachePool();125 $item = $pool->getItem('k')->set('foo');126 $pool->save($item);127 $calls = $pool->getCalls();128 $this->assertCount(2, $calls);129 $call = $calls[1];130 $this->assertSame('save', $call->name);131 $this->assertSame(['k' => true], $call->result);132 $this->assertSame(0, $call->hits);133 $this->assertSame(0, $call->misses);134 $this->assertNotEmpty($call->start);135 $this->assertNotEmpty($call->end);136 }137 public function testSaveDeferredTrace()138 {139 $pool = $this->createCachePool();140 $item = $pool->getItem('k')->set('foo');141 $pool->saveDeferred($item);142 $calls = $pool->getCalls();143 $this->assertCount(2, $calls);144 $call = $calls[1];145 $this->assertSame('saveDeferred', $call->name);146 $this->assertSame(['k' => true], $call->result);147 $this->assertSame(0, $call->hits);148 $this->assertSame(0, $call->misses);149 $this->assertNotEmpty($call->start);150 $this->assertNotEmpty($call->end);151 }152 public function testCommitTrace()153 {154 $pool = $this->createCachePool();155 $pool->commit();156 $calls = $pool->getCalls();157 $this->assertCount(1, $calls);158 $call = $calls[0];159 $this->assertSame('commit', $call->name);160 $this->assertTrue($call->result);161 $this->assertSame(0, $call->hits);162 $this->assertSame(0, $call->misses);163 $this->assertNotEmpty($call->start);164 $this->assertNotEmpty($call->end);165 }166}...

Full Screen

Full Screen

TraceableCacheTest.php

Source:TraceableCacheTest.php Github

copy

Full Screen

...26 public function testGetMissTrace()27 {28 $pool = $this->createSimpleCache();29 $pool->get('k');30 $calls = $pool->getCalls();31 $this->assertCount(1, $calls);32 $call = $calls[0];33 $this->assertSame('get', $call->name);34 $this->assertSame(['k' => false], $call->result);35 $this->assertSame(0, $call->hits);36 $this->assertSame(1, $call->misses);37 $this->assertNotEmpty($call->start);38 $this->assertNotEmpty($call->end);39 }40 public function testGetHitTrace()41 {42 $pool = $this->createSimpleCache();43 $pool->set('k', 'foo');44 $pool->get('k');45 $calls = $pool->getCalls();46 $this->assertCount(2, $calls);47 $call = $calls[1];48 $this->assertSame(1, $call->hits);49 $this->assertSame(0, $call->misses);50 }51 public function testGetMultipleMissTrace()52 {53 $pool = $this->createSimpleCache();54 $pool->set('k1', 123);55 $values = $pool->getMultiple(['k0', 'k1']);56 foreach ($values as $value) {57 }58 $calls = $pool->getCalls();59 $this->assertCount(2, $calls);60 $call = $calls[1];61 $this->assertSame('getMultiple', $call->name);62 $this->assertSame(['k1' => true, 'k0' => false], $call->result);63 $this->assertSame(1, $call->misses);64 $this->assertNotEmpty($call->start);65 $this->assertNotEmpty($call->end);66 }67 public function testHasMissTrace()68 {69 $pool = $this->createSimpleCache();70 $pool->has('k');71 $calls = $pool->getCalls();72 $this->assertCount(1, $calls);73 $call = $calls[0];74 $this->assertSame('has', $call->name);75 $this->assertSame(['k' => false], $call->result);76 $this->assertNotEmpty($call->start);77 $this->assertNotEmpty($call->end);78 }79 public function testHasHitTrace()80 {81 $pool = $this->createSimpleCache();82 $pool->set('k', 'foo');83 $pool->has('k');84 $calls = $pool->getCalls();85 $this->assertCount(2, $calls);86 $call = $calls[1];87 $this->assertSame('has', $call->name);88 $this->assertSame(['k' => true], $call->result);89 $this->assertNotEmpty($call->start);90 $this->assertNotEmpty($call->end);91 }92 public function testDeleteTrace()93 {94 $pool = $this->createSimpleCache();95 $pool->delete('k');96 $calls = $pool->getCalls();97 $this->assertCount(1, $calls);98 $call = $calls[0];99 $this->assertSame('delete', $call->name);100 $this->assertSame(['k' => true], $call->result);101 $this->assertSame(0, $call->hits);102 $this->assertSame(0, $call->misses);103 $this->assertNotEmpty($call->start);104 $this->assertNotEmpty($call->end);105 }106 public function testDeleteMultipleTrace()107 {108 $pool = $this->createSimpleCache();109 $arg = ['k0', 'k1'];110 $pool->deleteMultiple($arg);111 $calls = $pool->getCalls();112 $this->assertCount(1, $calls);113 $call = $calls[0];114 $this->assertSame('deleteMultiple', $call->name);115 $this->assertSame(['keys' => $arg, 'result' => true], $call->result);116 $this->assertSame(0, $call->hits);117 $this->assertSame(0, $call->misses);118 $this->assertNotEmpty($call->start);119 $this->assertNotEmpty($call->end);120 }121 public function testTraceSetTrace()122 {123 $pool = $this->createSimpleCache();124 $pool->set('k', 'foo');125 $calls = $pool->getCalls();126 $this->assertCount(1, $calls);127 $call = $calls[0];128 $this->assertSame('set', $call->name);129 $this->assertSame(['k' => true], $call->result);130 $this->assertSame(0, $call->hits);131 $this->assertSame(0, $call->misses);132 $this->assertNotEmpty($call->start);133 $this->assertNotEmpty($call->end);134 }135 public function testSetMultipleTrace()136 {137 $pool = $this->createSimpleCache();138 $pool->setMultiple(['k' => 'foo']);139 $calls = $pool->getCalls();140 $this->assertCount(1, $calls);141 $call = $calls[0];142 $this->assertSame('setMultiple', $call->name);143 $this->assertSame(['keys' => ['k'], 'result' => true], $call->result);144 $this->assertSame(0, $call->hits);145 $this->assertSame(0, $call->misses);146 $this->assertNotEmpty($call->start);147 $this->assertNotEmpty($call->end);148 }149}...

Full Screen

Full Screen

calls

Using AI Code Generation

copy

Full Screen

1use atoum\atoum;2use PHPUnit\Framework\TestCase;3use PhpSpec\ObjectBehavior;4use Prophecy\Argument;5use Behat\Behat\Context\Context;6use Codeception\Test\Unit;7use Kahlan\Plugin\Double;8use Peridot\Leo\Interfaces\Assert;9use PhpUnitGen\Generator\Generator;10use PHPSpec2\ObjectBehavior;11use PHPSpec2\Specification;12use PHPSpec2\SpecificationInterface;13use PHPSpec2\Specification\Behavior;14use PHPSpec2\Specification\Collaborator;15use PHPSpec2\Specification\Example;16use PHPSpec2\Specification\Example\ExampleInterface;17use PHPSpec2\Specification\Example\PendingException;18use PHPSpec2\Specification\Example\SkippedException;19use PHPSpec2\Specification\Example\SpecificationExample;20use PHPSpec2\Specification\Mocker;21use PHPSpec2\Specification\Prophecy\Prophet;22use PHPSpec2\Specification\Wrapper\ArgumentsWildcard;23use PHPSpec2\Specification\Wrapper\ArgumentsWildcard\AnyArgumentsWildcard;24use PHPSpec2\Specification\Wrapper\ArgumentsWildcard\ArgumentsWildcardInterface;

Full Screen

Full Screen

calls

Using AI Code Generation

copy

Full Screen

1{2 public function test1()3 {4 $this->boolean(true)->isTrue();5 }6}7{8 public function test2()9 {10 $this->boolean(true)->isTrue();11 }12}13{14 public function test3()15 {16 $this->boolean(true)->isTrue();17 }18}19{20 public function test4()21 {22 $this->boolean(true)->isTrue();23 }24}25{26 public function test5()27 {28 $this->boolean(true)->isTrue();29 }30}31{32 public function test6()33 {34 $this->boolean(true)->isTrue();35 }36}37{38 public function test7()39 {40 $this->boolean(true)->isTrue();41 }42}43{44 public function test8()45 {46 $this->boolean(true)->isTrue();47 }48}49{50 public function test9()51 {52 $this->boolean(true)->isTrue();53 }54}55{56 public function test10()57 {58 $this->boolean(true)->isTrue();59 }60}

Full Screen

Full Screen

calls

Using AI Code Generation

copy

Full Screen

1$test = new \mageekguy\atoum\test();2$test->setTestNamespace('mageekguy\atoum\tests\units\asserters');3$test = new \PHPUnit_Framework_TestCase();4$test->setTestNamespace('mageekguy\atoum\tests\units\asserters');5$test = new \mageekguy\atoum\test();6$test->setTestNamespace('mageekguy\atoum\tests\units\asserters');7$test = new \PHPUnit_Framework_TestCase();8$test->setTestNamespace('mageekguy\atoum\tests\units\asserters');9$test = new \mageekguy\atoum\test();10$test->setTestNamespace('mageekguy\atoum\tests\units\asserters');11$test = new \PHPUnit_Framework_TestCase();12$test->setTestNamespace('mageekguy\atoum\tests\units\asserters');13$test = new \mageekguy\atoum\test();14$test->setTestNamespace('mageekguy\atoum\tests\units\asserters');15$test = new \PHPUnit_Framework_TestCase();16$test->setTestNamespace('mageekguy\atoum\tests\units\asserters');17$test = new \mageekguy\atoum\test();18$test->setTestNamespace('mageekguy\atoum\tests\units\asserters');19$test = new \PHPUnit_Framework_TestCase();20$test->setTestNamespace('mageekguy\atoum\tests\units\asserters');21$test = new \mageekguy\atoum\test();22$test->setTestNamespace('mageekguy\atoum\tests\units\asserters');23$test = new \PHPUnit_Framework_TestCase();24$test->setTestNamespace('mageekguy\atoum\tests\units\asserters');25$test = new \mageekguy\atoum\test();

Full Screen

Full Screen

calls

Using AI Code Generation

copy

Full Screen

1require_once 'atoum.php';2{3 public function testMe()4 {5 $this->assert->string('hello')->isIdenticalTo('hello');6 }7}8require_once 'PHPUnit/Autoload.php';9{10 public function testMe()11 {12 $this->assertEquals('hello', 'hello');13 }14}15require_once 'PHPSpec/PHPSpec.php';16{17 public function it_should_work()18 {19 $this->string('hello')->should->beIdenticalTo('hello');20 }21}22require_once 'simpletest/autorun.php';23{24 public function testMe()25 {26 $this->assertIdentical('hello', 'hello');27 }28}29require_once 'PHPUnit/Autoload.php';30{31 public function testMe()32 {33 $this->assertEquals('hello', 'hello');34 }35}36require_once 'PHPSpec/PHPSpec.php';37{38 public function it_should_work()39 {40 $this->string('hello')->should->beIdenticalTo('hello');41 }42}43require_once 'PHPUnit/Autoload.php';44{45 public function testMe()46 {47 $this->assertEquals('hello', 'hello');48 }49}50require_once 'PHPSpec/PHPSpec.php';51{52 public function it_should_work()53 {54 $this->string('hello')->

Full Screen

Full Screen

calls

Using AI Code Generation

copy

Full Screen

1require __DIR__.'/vendor/autoload.php';2use Atoum\Atoum;3$atoum = new Atoum();4echo $atoum->getHelloWorld();5require __DIR__.'/vendor/autoload.php';6use Atoum\Atoum;7$atoum = new Atoum();8echo $atoum->getHelloWorld();

Full Screen

Full Screen

calls

Using AI Code Generation

copy

Full Screen

1require_once 'vendor/autoload.php';2require_once 'class.php';3{4 public function testClass()5 {6 $this->assert->class('class')->hasInterface('interface');7 }8}9{10}11{12}13require_once 'vendor/autoload.php';14require_once 'class.php';15{16 public function testClass()17 {18 $this->assertInstanceOf('class', new class);19 }20}21require_once __DIR__.'/../vendor/autoload.php';22use mageekguy\atoum;23$runner = new atoum\scripts\runner();24 ->addTestsFromDirectory(__DIR__.'/../tests/units')25 ->run()26;27require_once __DIR__.'/../vendor/autoload.php';28use mageekguy\atoum;29$runner = new atoum\scripts\runner();30 ->addTestsFromDirectory(__DIR__.'/../tests/units')31 ->run()32;

Full Screen

Full Screen

calls

Using AI Code Generation

copy

Full Screen

1require_once 'path/to/atoum.php';2$test = new atoum();3$test->addTest('path/to/2.php');4$test->run();5require_once 'path/to/atoum.php';6$test = new atoum();7$test->addTest('path/to/3.php');8$test->run();9require_once 'path/to/atoum.php';10$test = new atoum();11$test->addTest('path/to/1.php');12$test->run();13require_once 'path/to/atoum.php';14$test = new atoum();15$test->addTest('path/to/2.php');16$test->run();17require_once 'path/to/atoum.php';18$test = new atoum();19$test->addTest('path/to/3.php');20$test->run();21require_once 'path/to/atoum.php';22$test = new atoum();23$test->addTest('path/to/1.php');24$test->run();25require_once 'path/to/atoum.php';26$test = new atoum();27$test->addTest('path/to/2.php');28$test->run();29require_once 'path/to/atoum.php';30$test = new atoum();31$test->addTest('path/to/3.php');32$test->run();33require_once 'path/to/atoum.php';34$test = new atoum();

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.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful