Best Atoum code snippet using call.identical
calls.php
Source:calls.php
1<?php2namespace mageekguy\atoum\tests\units\test\adapter;3require __DIR__ . '/../../../runner.php';4use mageekguy\atoum;5use mageekguy\atoum\test\adapter;6use mageekguy\atoum\test\adapter\calls as testedClass;7use mock\mageekguy\atoum\test\adapter\calls as mockedTestedClass;8class calls extends atoum\test9{10 public function testClass()11 {12 $this->testedClass13 ->implements(\countable::class)14 ->implements(\arrayAccess::class)15 ->implements(\iteratorAggregate::class)16 ;17 }18 public function test__construct()19 {20 $this21 ->if($calls = new testedClass())22 ->then23 ->sizeof($calls)->isZero()24 ;25 }26 public function test__invoke()27 {28 $this29 ->if($calls = new testedClass())30 ->then31 ->array($calls())->isEmpty()32 ->if($calls[] = $call = new adapter\call(uniqid()))33 ->then34 ->array($calls())->isEqualTo([$call->getFunction() => [1 => $call]])35 ->object[$call->getFunction()][1]->isIdenticalTo($call)36 ->if($calls[] = $otherCall = new adapter\call($call->getFunction()))37 ->then38 ->array($calls())->isEqualTo([$call->getFunction() => [1 => $call, 2 => $otherCall]])39 ->object[$call->getFunction()][1]->isIdenticalTo($call)40 ->object[$call->getFunction()][2]->isIdenticalTo($otherCall)41 ->object[$otherCall->getFunction()][2]->isIdenticalTo($otherCall)42 ->if($calls[] = $anotherCall = new adapter\call(uniqid()))43 ->then44 ->array($calls())->isEqualTo(45 [46 $call->getFunction() => [1 => $call, 2 => $otherCall],47 $anotherCall->getFunction() => [3 => $anotherCall]48 ]49 )50 ->object[$call->getFunction()][1]->isIdenticalTo($call)51 ->object[$call->getFunction()][2]->isIdenticalTo($otherCall)52 ->object[$otherCall->getFunction()][2]->isIdenticalTo($otherCall)53 ->object[$anotherCall->getFunction()][3]->isIdenticalTo($anotherCall)54 ;55 }56 public function test__toString()57 {58 $this59 ->if($calls = new testedClass())60 ->then61 ->castToString($calls)->isEqualTo($calls->getDecorator()->decorate($calls))62 ;63 }64 public function testCount()65 {66 $this67 ->if($calls = new testedClass())68 ->then69 ->sizeof($calls)->isZero()70 ->if($calls[] = $call1 = new adapter\call(uniqid()))71 ->then72 ->sizeof($calls)->isEqualTo(1)73 ->if($otherCalls = new testedClass())74 ->and($otherCalls[] = $call2 = new adapter\call(uniqid()))75 ->then76 ->sizeof($calls)->isEqualTo(1)77 ->sizeof($otherCalls)->isEqualTo(1)78 ->if($calls[] = $call2 = new adapter\call(uniqid()))79 ->then80 ->sizeof($calls)->isEqualTo(2)81 ->sizeof($otherCalls)->isEqualTo(1)82 ->if($calls[] = $call3 = new adapter\call($call1->getFunction()))83 ->then84 ->sizeof($calls)->isEqualTo(3)85 ->sizeof($otherCalls)->isEqualTo(1)86 ;87 }88 public function testSetDecorator()89 {90 $this91 ->if($calls = new testedClass())92 ->then93 ->object($calls->setDecorator($decorator = new adapter\calls\decorator()))->isIdenticalTo($calls)94 ->object($calls->getDecorator())->isIdenticalTo($decorator)95 ->object($calls->setDecorator())->isIdenticalTo($calls)96 ->object($calls->getDecorator())97 ->isNotIdenticalTo($decorator)98 ->isEqualTo(new adapter\calls\decorator())99 ;100 }101 public function testReset()102 {103 $this104 ->if($calls = new testedClass())105 ->then106 ->object($calls->reset())->isIdenticalTo($calls)107 ->sizeof($calls)->isZero()108 ->if($calls[] = new adapter\call(uniqid()))109 ->then110 ->object($calls->reset())->isIdenticalTo($calls)111 ->sizeof($calls)->isZero()112 ->if($calls[] = $call = new adapter\call(uniqid()))113 ->then114 ->array($calls[$call->getFunction()]->toArray())->isEqualTo([2 => $call])115 ;116 }117 public function testAddCall()118 {119 $this120 ->if($calls = new testedClass())121 ->then122 ->object($calls->addCall($call = new adapter\call(uniqid())))->isIdenticalTo($calls)123 ->array($calls[$call->getFunction()]->toArray())124 ->isEqualTo([1 => $call])125 ->object[1]->isIdenticalTo($call)126 ;127 }128 public function testRemoveCall()129 {130 $this131 ->if($calls = new testedClass())132 ->then133 ->object($calls->removeCall(new adapter\call(uniqid()), rand(0, PHP_INT_MAX)))->isIdenticalTo($calls)134 ->sizeof($calls)->isZero()135 ->if($calls->addCall($call = new adapter\call(uniqid())))136 ->then137 ->object($calls->removeCall(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isIdenticalTo($calls)138 ->sizeof($calls)->isEqualTo(1)139 ->object($calls->removeCall($call, rand(2, PHP_INT_MAX)))->isIdenticalTo($calls)140 ->sizeof($calls)->isEqualTo(1)141 ->object($calls->removeCall($call, 1))->isIdenticalTo($calls)142 ->sizeof($calls)->isZero()143 ;144 }145 public function testOffsetSet()146 {147 $this148 ->if($calls = new testedClass())149 ->then150 ->exception(function () use ($calls) {151 $calls[] = new adapter\call();152 })153 ->isInstanceOf(atoum\exceptions\logic\invalidArgument::class)154 ->hasMessage('Function is undefined')155 ->if($calls[] = $call1 = new adapter\call(uniqid()))156 ->then157 ->array($calls[$call1]->toArray())158 ->isEqualTo([1 => $call1])159 ->object[1]->isIdenticalTo($call1)160 ->if($calls[] = $call2 = new adapter\call(uniqid(), []))161 ->then162 ->array($calls[$call1]->toArray())163 ->isEqualTo([1 => $call1])164 ->object[1]->isIdenticalTo($call1)165 ->array($calls[$call2]->toArray())166 ->isEqualTo([2 => $call2])167 ->object[2]->isIdenticalTo($call2)168 ->if($calls[] = $call3 = new adapter\call($call1->getFunction(), []))169 ->then170 ->array($calls[$call1]->toArray())171 ->isEqualTo([1 => $call1, 3 => $call3])172 ->object[1]->isIdenticalTo($call1)173 ->object[3]->isIdenticalTo($call3)174 ->array($calls[$call2]->toArray())175 ->isEqualTo([2 => $call2])176 ->object[2]->isIdenticalTo($call2)177 ->if($calls[] = $call4 = new adapter\call(uniqid()))178 ->then179 ->array($calls[$call1]->toArray())180 ->isEqualTo([1 => $call1, 3 => $call3])181 ->object[1]->isIdenticalTo($call1)182 ->object[3]->isIdenticalTo($call3)183 ->array($calls[$call2]->toArray())184 ->isEqualTo([2 => $call2])185 ->object[2]->isIdenticalTo($call2)186 ->array($calls[$call4->getFunction()]->toArray())187 ->isEqualTo([4 => $call4])188 ->object[4]->isIdenticalTo($call4)189 ->if($calls[$newFunction = uniqid()] = $call5 = new adapter\call(uniqid()))190 ->then191 ->array($calls[$newFunction]->toArray())->isEqualTo([5 => $call5])192 ->object[5]->isIdenticalTo($call5)193 ->string($call5->getFunction())->isEqualTo($newFunction)194 ;195 }196 public function testOffsetGet()197 {198 $this199 ->if($calls = new testedClass())200 ->then201 ->array($calls[uniqid()]->toArray())->isEmpty()202 ->if($calls[] = $call1 = new adapter\call(uniqid()))203 ->then204 ->array($calls[$call1->getFunction()]->toArray())205 ->isEqualTo([1 => $call1])206 ->object[1]->isIdenticalTo($call1)207 ->array($calls[$call1]->toArray())208 ->isEqualTo([1 => $call1])209 ->object[1]->isIdenticalTo($call1)210 ->if($calls[] = $call2 = new adapter\call($call1->getFunction(), []))211 ->then212 ->array($calls[uniqid()]->toArray())->isEmpty()213 ->array($calls[$call1->getFunction()]->toArray())214 ->isEqualTo([1 => $call1, 2 => $call2])215 ->object[1]->isIdenticalTo($call1)216 ->object[2]->isIdenticalTo($call2)217 ->array($calls[$call1]->toArray())218 ->isEqualTo([1 => $call1, 2 => $call2])219 ->object[1]->isIdenticalTo($call1)220 ->object[2]->isIdenticalTo($call2)221 ->array($calls[$call2->getFunction()]->toArray())222 ->isEqualTo([1 => $call1, 2 => $call2])223 ->object[1]->isIdenticalTo($call1)224 ->object[2]->isIdenticalTo($call2)225 ->array($calls[$call2]->toArray())226 ->isEqualTo([2 => $call2])227 ->object[2]->isIdenticalTo($call2)228 ;229 }230 public function testOffsetExists()231 {232 $this233 ->if($calls = new testedClass())234 ->then235 ->boolean(isset($calls[uniqid()]))->isFalse()236 ->if($calls[] = $call = new adapter\call(uniqid()))237 ->then238 ->boolean(isset($calls[uniqid()]))->isFalse()239 ->boolean(isset($calls[$call->getFunction()]))->isTrue()240 ->boolean(isset($calls[$call]))->isTrue()241 ;242 }243 public function testOffsetUnset()244 {245 $this246 ->if($calls = new testedClass())247 ->when(function () use ($calls) {248 unset($calls[uniqid()]);249 })250 ->then251 ->sizeof($calls)->isZero252 ->if($calls[] = $call = new adapter\call(uniqid()))253 ->when(function () use ($calls) {254 unset($calls[uniqid()]);255 })256 ->then257 ->boolean(isset($calls[$call->getFunction()]))->isTrue()258 ->sizeof($calls)->isEqualTo(1)259 ->when(function () use ($calls, $call) {260 unset($calls[$call->getFunction()]);261 })262 ->then263 ->boolean(isset($calls[$call->getFunction()]))->isFalse()264 ->sizeof($calls)->isZero265 ;266 }267 public function testGetIterator()268 {269 $this270 ->if($calls = new testedClass())271 ->then272 ->object($calls->getIterator())->isEqualTo(new \arrayIterator($calls()))273 ;274 }275 public function testToArray()276 {277 $this278 ->if($calls = new testedClass())279 ->then280 ->array($calls->toArray())->isEmpty()281 ->array($calls->toArray(new adapter\call(uniqid())))->isEmpty()282 ->if($calls->addCall($call1 = new adapter\call(uniqid())))283 ->then284 ->array($calls->toArray())->isEqualTo([1 => $call1])285 ->array($calls->toArray(new adapter\call(uniqid())))->isEmpty()286 ->array($calls->toArray($call1))->isEqualTo([1 => $call1])287 ->if($calls->addCall($call2 = clone $call1))288 ->then289 ->array($calls->toArray())->isEqualTo([1 => $call1, 2 => $call2])290 ->array($calls->toArray(new adapter\call(uniqid())))->isEmpty()291 ->array($calls->toArray($call1))->isEqualTo([1 => $call1, 2 => $call2])292 ->array($calls->toArray($call2))->isEqualTo([1 => $call1, 2 => $call2])293 ->if($calls->addCall($call3 = new adapter\call(uniqid())))294 ->then295 ->array($calls->toArray())->isEqualTo([1 => $call1, 2 => $call2, 3 => $call3])296 ->array($calls->toArray(new adapter\call(uniqid())))->isEmpty()297 ->array($calls->toArray($call1))->isEqualTo([1 => $call1, 2 => $call2])298 ->array($calls->toArray($call2))->isEqualTo([1 => $call1, 2 => $call2])299 ->array($calls->toArray($call3))->isEqualTo([3 => $call3])300 ;301 }302 public function testGetEqualTo()303 {304 $this305 ->if($calls = new testedClass())306 ->then307 ->object($calls->getEqualTo(new adapter\call(uniqid())))308 ->isInstanceOf(atoum\test\adapter\calls::class)309 ->hasSize(0)310 ->if($calls[] = $call1 = new adapter\call(uniqid()))311 ->then312 ->object($calls->getEqualTo(new adapter\call(uniqid())))313 ->isInstanceOf(atoum\test\adapter\calls::class)314 ->hasSize(0)315 ->object($calls->getEqualTo($call1))316 ->isInstanceOf(atoum\test\adapter\calls::class)317 ->hasSize(1)318 ->array($calls->getEqualTo($call1)->toArray())319 ->isEqualTo([1 => $call1])320 ->if($calls[] = $call2 = new adapter\call($call1->getFunction(), []))321 ->then322 ->object($calls->getEqualTo(new adapter\call(uniqid())))323 ->isInstanceOf(atoum\test\adapter\calls::class)324 ->hasSize(0)325 ->object($calls->getEqualTo($call1))326 ->isInstanceOf(atoum\test\adapter\calls::class)327 ->hasSize(2)328 ->array($calls->getEqualTo($call1)->toArray())329 ->isEqualTo([1 => $call1, 2 => $call2])330 ->object($calls->getEqualTo($call2))331 ->isInstanceOf(atoum\test\adapter\calls::class)332 ->hasSize(1)333 ->array($calls->getEqualTo($call2)->toArray())334 ->isEqualTo([2 => $call2])335 ->if($calls[] = $call3 = new adapter\call($call1->getFunction(), [$object = new \mock\phpObject()]))336 ->then337 ->object($calls->getEqualTo(new adapter\call(uniqid())))338 ->isInstanceOf(atoum\test\adapter\calls::class)339 ->hasSize(0)340 ->object($calls->getEqualTo($call1))341 ->isInstanceOf(atoum\test\adapter\calls::class)342 ->hasSize(3)343 ->array($calls->getEqualTo($call1)->toArray())344 ->isEqualTo([1 => $call1, 2 => $call2, 3 => $call3])345 ->object($calls->getEqualTo($call2))346 ->isInstanceOf(atoum\test\adapter\calls::class)347 ->hasSize(1)348 ->array($calls->getEqualTo($call2)->toArray())349 ->isEqualTo([2 => $call2])350 ->object($calls->getEqualTo($call3))351 ->isInstanceOf(atoum\test\adapter\calls::class)352 ->hasSize(1)353 ->array($calls->getEqualTo($call3)->toArray())354 ->isEqualTo([3 => $call3])355 ->if($calls[] = $call4 = new adapter\call($call1->getFunction(), [$object = new \mock\phpObject(), $arg = uniqid()]))356 ->then357 ->object($calls->getEqualTo(new adapter\call(uniqid())))358 ->isInstanceOf(atoum\test\adapter\calls::class)359 ->hasSize(0)360 ->object($calls->getEqualTo($call1))361 ->isInstanceOf(atoum\test\adapter\calls::class)362 ->hasSize(4)363 ->array($calls->getEqualTo($call1)->toArray())364 ->isEqualTo([1 => $call1, 2 => $call2, 3 => $call3, 4 => $call4])365 ->object($calls->getEqualTo($call2))366 ->isInstanceOf(atoum\test\adapter\calls::class)367 ->hasSize(1)368 ->array($calls->getEqualTo($call2)->toArray())369 ->isEqualTo([2 => $call2])370 ->object($calls->getEqualTo($call3))371 ->isInstanceOf(atoum\test\adapter\calls::class)372 ->hasSize(2)373 ->array($calls->getEqualTo($call3)->toArray())374 ->isEqualTo([3 => $call3, 4 => $call4])375 ->object($calls->getEqualTo(new adapter\call($call1->getFunction(), [clone $object])))376 ->isInstanceOf(atoum\test\adapter\calls::class)377 ->hasSize(2)378 ->array($calls->getEqualTo($call3)->toArray())379 ->isEqualTo([3 => $call3, 4 => $call4])380 ->object($calls->getEqualTo($call4))381 ->isInstanceOf(atoum\test\adapter\calls::class)382 ->hasSize(1)383 ->array($calls->getEqualTo($call4)->toArray())384 ->isEqualTo([4 => $call4])385 ->object($calls->getEqualTo(new adapter\call($call1->getFunction(), [clone $object, $arg])))386 ->isInstanceOf(atoum\test\adapter\calls::class)387 ->hasSize(1)388 ->array($calls->getEqualTo($call4)->toArray())389 ->isEqualTo([4 => $call4])390 ->if($calls = new testedClass())391 ->and($calls[] = $call5 = new adapter\call(uniqid(), [1, 2, 3, 4, 5]))392 ->then393 ->object($calls->getEqualTo(new adapter\call($call5->getFunction())))394 ->isInstanceOf(atoum\test\adapter\calls::class)395 ->hasSize(1)396 ->array($calls->getEqualTo(new adapter\call($call5->getFunction()))->toArray())397 ->isEqualTo([5 => $call5])398 ;399 }400 public function testGetIdenticalTo()401 {402 $this403 ->if($calls = new testedClass())404 ->then405 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))406 ->isInstanceOf(atoum\test\adapter\calls::class)407 ->hasSize(0)408 ->if($calls[] = $call1 = new adapter\call(uniqid()))409 ->then410 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))411 ->isInstanceOf(atoum\test\adapter\calls::class)412 ->hasSize(0)413 ->object($calls->getIdenticalTo($call1))414 ->isInstanceOf(atoum\test\adapter\calls::class)415 ->hasSize(1)416 ->array($calls->getIdenticalTo($call1)->toArray())417 ->isEqualTo([1 => $call1])418 ->if($calls[] = $call2 = new adapter\call($call1->getFunction(), []))419 ->then420 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))421 ->isInstanceOf(atoum\test\adapter\calls::class)422 ->hasSize(0)423 ->object($calls->getIdenticalTo($call1))424 ->isInstanceOf(atoum\test\adapter\calls::class)425 ->hasSize(2)426 ->array($calls->getIdenticalTo($call1)->toArray())427 ->isEqualTo([1 => $call1, 2 => $call2])428 ->object($calls->getIdenticalTo($call2))429 ->isInstanceOf(atoum\test\adapter\calls::class)430 ->hasSize(1)431 ->array($calls->getIdenticalTo($call2)->toArray())432 ->isEqualTo([2 => $call2])433 ->if($calls[] = $call3 = new adapter\call($call1->getFunction(), [$object = new \mock\phpObject()]))434 ->then435 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))436 ->isInstanceOf(atoum\test\adapter\calls::class)437 ->hasSize(0)438 ->object($calls->getIdenticalTo($call1))439 ->isInstanceOf(atoum\test\adapter\calls::class)440 ->hasSize(3)441 ->array($calls->getIdenticalTo($call1)->toArray())442 ->isEqualTo([1 => $call1, 2 => $call2, 3 => $call3])443 ->object($calls->getIdenticalTo($call2))444 ->isInstanceOf(atoum\test\adapter\calls::class)445 ->hasSize(1)446 ->array($calls->getIdenticalTo($call2)->toArray())447 ->isEqualTo([2 => $call2])448 ->object($calls->getIdenticalTo($call3))449 ->isInstanceOf(atoum\test\adapter\calls::class)450 ->hasSize(1)451 ->array($calls->getIdenticalTo($call3)->toArray())452 ->isEqualTo([3 => $call3])453 ->object($calls->getIdenticalTo(new adapter\call($call1->getFunction(), [clone $object])))454 ->isInstanceOf(atoum\test\adapter\calls::class)455 ->hasSize(0)456 ->if($calls[] = $call4 = new adapter\call($call1->getFunction(), [$object = new \mock\phpObject(), $arg = uniqid()]))457 ->then458 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))459 ->isInstanceOf(atoum\test\adapter\calls::class)460 ->hasSize(0)461 ->object($calls->getIdenticalTo($call1))462 ->isInstanceOf(atoum\test\adapter\calls::class)463 ->hasSize(4)464 ->array($calls->getIdenticalTo($call1)->toArray())465 ->isEqualTo([1 => $call1, 2 => $call2, 3 => $call3, 4 => $call4])466 ->object($calls->getIdenticalTo($call2))467 ->isInstanceOf(atoum\test\adapter\calls::class)468 ->hasSize(1)469 ->array($calls->getIdenticalTo($call2)->toArray())470 ->isEqualTo([2 => $call2])471 ->object($calls->getIdenticalTo($call3))472 ->isInstanceOf(atoum\test\adapter\calls::class)473 ->hasSize(1)474 ->array($calls->getIdenticalTo($call3)->toArray())475 ->isEqualTo([3 => $call3])476 ->object($calls->getIdenticalTo(new adapter\call($call1->getFunction(), [clone $object])))477 ->isInstanceOf(atoum\test\adapter\calls::class)478 ->hasSize(0)479 ->object($calls->getIdenticalTo($call4))480 ->isInstanceOf(atoum\test\adapter\calls::class)481 ->hasSize(1)482 ->array($calls->getIdenticalTo($call4)->toArray())483 ->isEqualTo([4 => $call4])484 ->object($calls->getIdenticalTo(new adapter\call($call1->getFunction(), [clone $object, $arg])))485 ->isInstanceOf(atoum\test\adapter\calls::class)486 ->hasSize(0)487 ;488 }489 public function testGetPreviousEqualTo()490 {491 $this492 ->if($calls = new testedClass())493 ->then494 ->object($calls->getPreviousEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))495 ->isInstanceOf(atoum\test\adapter\calls::class)496 ->hasSize(0)497 ->if($calls[] = $call1 = new adapter\call(uniqid()))498 ->then499 ->object($calls->getPreviousEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))500 ->isInstanceOf(atoum\test\adapter\calls::class)501 ->hasSize(0)502 ->object($calls->getPreviousEqualTo(new adapter\call($call1), 0))503 ->isInstanceOf(atoum\test\adapter\calls::class)504 ->hasSize(0)505 ->object($calls->getPreviousEqualTo(new adapter\call($call1), 1))506 ->isInstanceOf(atoum\test\adapter\calls::class)507 ->hasSize(0)508 ->object($calls->getPreviousEqualTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))509 ->isInstanceOf(atoum\test\adapter\calls::class)510 ->hasSize(0)511 ->if($calls[] = $call2 = new adapter\call(uniqid(), []))512 ->then513 ->object($calls->getPreviousEqualTo(new adapter\call(uniqid()), 1))514 ->isInstanceOf(atoum\test\adapter\calls::class)515 ->hasSize(0)516 ->object($calls->getPreviousEqualTo($call1, 1))517 ->isInstanceOf(atoum\test\adapter\calls::class)518 ->hasSize(0)519 ->object($previousCalls = $calls->getPreviousEqualTo($call1, 2))520 ->isInstanceOf(atoum\test\adapter\calls::class)521 ->hasSize(1)522 ->array($previousCalls->toArray())523 ->isEqualTo([1 => $call1])524 ->object($calls->getPreviousEqualTo($call2, 1))525 ->isInstanceOf(atoum\test\adapter\calls::class)526 ->hasSize(0)527 ->object($calls->getPreviousEqualTo($call2, 2))528 ->isInstanceOf(atoum\test\adapter\calls::class)529 ->hasSize(0)530 ->if($calls[] = $call3 = new adapter\call(uniqid(), [$object = new \mock\phpObject()]))531 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), [clone $object]))532 ->and($calls[] = $call5 = new adapter\call(uniqid(), []))533 ->then534 ->object($calls->getPreviousEqualTo(new adapter\call(uniqid()), 1))535 ->isInstanceOf(atoum\test\adapter\calls::class)536 ->hasSize(0)537 ->object($calls->getPreviousEqualTo($call1, 1))538 ->isInstanceOf(atoum\test\adapter\calls::class)539 ->hasSize(0)540 ->object($previousCalls = $calls->getPreviousEqualTo($call1, 2))541 ->isInstanceOf(atoum\test\adapter\calls::class)542 ->hasSize(1)543 ->array($previousCalls->toArray())544 ->isEqualTo([1 => $call1])545 ->object($calls->getPreviousEqualTo($call2, 1))546 ->isInstanceOf(atoum\test\adapter\calls::class)547 ->hasSize(0)548 ->object($calls->getPreviousEqualTo($call2, 2))549 ->isInstanceOf(atoum\test\adapter\calls::class)550 ->hasSize(0)551 ->object($previousCalls = $calls->getPreviousEqualTo($call3, 4))552 ->isInstanceOf(atoum\test\adapter\calls::class)553 ->hasSize(1)554 ->array($previousCalls->toArray())555 ->isEqualTo([3 => $call3])556 ->object($previousCalls = $calls->getPreviousEqualTo($call4, 4))557 ->isInstanceOf(atoum\test\adapter\calls::class)558 ->hasSize(1)559 ->array($previousCalls->toArray())560 ->isEqualTo([3 => $call3])561 ->object($previousCalls = $calls->getPreviousEqualTo($call3, 5))562 ->isInstanceOf(atoum\test\adapter\calls::class)563 ->hasSize(2)564 ->array($previousCalls->toArray())565 ->isEqualTo([3 => $call3, 4 => $call4])566 ->object($previousCalls = $calls->getPreviousEqualTo($call4, 5))567 ->isInstanceOf(atoum\test\adapter\calls::class)568 ->hasSize(2)569 ->array($previousCalls->toArray())570 ->isEqualTo([3 => $call3, 4 => $call4])571 ;572 }573 public function testGetPreviousIdenticalTo()574 {575 $this576 ->if($calls = new testedClass())577 ->then578 ->object($calls->getPreviousIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))579 ->isInstanceOf(atoum\test\adapter\calls::class)580 ->hasSize(0)581 ->if($calls[] = $call1 = new adapter\call(uniqid()))582 ->then583 ->object($calls->getPreviousIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))584 ->isInstanceOf(atoum\test\adapter\calls::class)585 ->hasSize(0)586 ->object($calls->getPreviousIdenticalTo(new adapter\call($call1), 0))587 ->isInstanceOf(atoum\test\adapter\calls::class)588 ->hasSize(0)589 ->object($calls->getPreviousIdenticalTo(new adapter\call($call1), 1))590 ->isInstanceOf(atoum\test\adapter\calls::class)591 ->hasSize(0)592 ->object($calls->getPreviousIdenticalTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))593 ->isInstanceOf(atoum\test\adapter\calls::class)594 ->hasSize(0)595 ->if($calls[] = $call2 = new adapter\call(uniqid(), []))596 ->then597 ->object($calls->getPreviousIdenticalTo(new adapter\call(uniqid()), 1))598 ->isInstanceOf(atoum\test\adapter\calls::class)599 ->hasSize(0)600 ->object($calls->getPreviousIdenticalTo($call1, 1))601 ->isInstanceOf(atoum\test\adapter\calls::class)602 ->hasSize(0)603 ->object($previousCalls = $calls->getPreviousIdenticalTo($call1, 2))604 ->isInstanceOf(atoum\test\adapter\calls::class)605 ->hasSize(1)606 ->array($previousCalls->toArray())607 ->isIdenticalTo([1 => $call1])608 ->object($calls->getPreviousIdenticalTo($call2, 1))609 ->isInstanceOf(atoum\test\adapter\calls::class)610 ->hasSize(0)611 ->object($calls->getPreviousIdenticalTo($call2, 2))612 ->isInstanceOf(atoum\test\adapter\calls::class)613 ->hasSize(0)614 ->if($calls[] = $call3 = new adapter\call(uniqid(), [$object = new \mock\phpObject()]))615 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), [clone $object]))616 ->and($calls[] = $call5 = new adapter\call(uniqid(), []))617 ->then618 ->object($calls->getPreviousIdenticalTo(new adapter\call(uniqid()), 1))619 ->isInstanceOf(atoum\test\adapter\calls::class)620 ->hasSize(0)621 ->object($calls->getPreviousIdenticalTo($call1, 1))622 ->isInstanceOf(atoum\test\adapter\calls::class)623 ->hasSize(0)624 ->object($previousCalls = $calls->getPreviousIdenticalTo($call1, 2))625 ->isInstanceOf(atoum\test\adapter\calls::class)626 ->hasSize(1)627 ->array($previousCalls->toArray())628 ->isIdenticalTo([1 => $call1])629 ->object($calls->getPreviousIdenticalTo($call2, 1))630 ->isInstanceOf(atoum\test\adapter\calls::class)631 ->hasSize(0)632 ->object($calls->getPreviousIdenticalTo($call2, 2))633 ->isInstanceOf(atoum\test\adapter\calls::class)634 ->hasSize(0)635 ->object($previousCalls = $calls->getPreviousIdenticalTo($call3, 4))636 ->isInstanceOf(atoum\test\adapter\calls::class)637 ->hasSize(1)638 ->array($previousCalls->toArray())639 ->isIdenticalTo([3 => $call3])640 ->object($calls->getPreviousIdenticalTo($call4, 4))641 ->isInstanceOf(atoum\test\adapter\calls::class)642 ->hasSize(0)643 ->object($previousCalls = $calls->getPreviousIdenticalTo($call3, 5))644 ->isInstanceOf(atoum\test\adapter\calls::class)645 ->hasSize(1)646 ->array($previousCalls->toArray())647 ->isIdenticalTo([3 => $call3])648 ->object($previousCalls =$calls->getPreviousIdenticalTo($call4, 5))649 ->isInstanceOf(atoum\test\adapter\calls::class)650 ->hasSize(1)651 ->array($previousCalls->toArray())652 ->isIdenticalTo([4 => $call4])653 ;654 }655 public function testGetPrevious()656 {657 $this658 ->if($calls = new mockedTestedClass())659 ->then660 ->object($calls->getPrevious($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX)))661 ->isInstanceOf(atoum\test\adapter\calls::class)662 ->mock($calls)->call('getPreviousEqualTo')->withArguments($call, $position)->once()663 ->object($calls->getPrevious($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX), true))664 ->isInstanceOf(atoum\test\adapter\calls::class)665 ->mock($calls)->call('getPreviousIdenticalTo')->withArguments($call, $position)->once()666 ;667 }668 public function testHasPreviousEqualTo()669 {670 $this671 ->if($calls = new testedClass())672 ->then673 ->boolean($calls->hasPreviousEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()674 ->if($calls[] = $call1 = new adapter\call(uniqid()))675 ->then676 ->boolean($calls->hasPreviousEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()677 ->boolean($calls->hasPreviousEqualTo(new adapter\call($call1), 0))->isFalse()678 ->boolean($calls->hasPreviousEqualTo(new adapter\call($call1), 1))->isFalse()679 ->boolean($calls->hasPreviousEqualTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))->isFalse()680 ->if($calls[] = $call2 = new adapter\call(uniqid(), []))681 ->then682 ->boolean($calls->hasPreviousEqualTo(new adapter\call(uniqid()), 1))->isFalse()683 ->boolean($calls->hasPreviousEqualTo($call1, 1))->isFalse()684 ->boolean($previousCalls = $calls->hasPreviousEqualTo($call1, 2))->isTrue()685 ->boolean($calls->hasPreviousEqualTo($call2, 1))->isFalse()686 ->boolean($calls->hasPreviousEqualTo($call2, 2))->isFalse()687 ->if($calls[] = $call3 = new adapter\call(uniqid(), [$object = new \mock\phpObject()]))688 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), [clone $object]))689 ->and($calls[] = $call5 = new adapter\call(uniqid(), []))690 ->then691 ->boolean($calls->hasPreviousEqualTo(new adapter\call(uniqid()), 1))->isFalse()692 ->boolean($calls->hasPreviousEqualTo($call1, 1))->isFalse()693 ->boolean($previousCalls = $calls->hasPreviousEqualTo($call1, 2))->isTrue()694 ->boolean($calls->hasPreviousEqualTo($call2, 1))->isFalse()695 ->boolean($calls->hasPreviousEqualTo($call2, 2))->isFalse()696 ->boolean($previousCalls = $calls->hasPreviousEqualTo($call3, 4))->isTrue()697 ->boolean($previousCalls = $calls->hasPreviousEqualTo($call4, 4))->isTrue()698 ->boolean($previousCalls = $calls->hasPreviousEqualTo($call3, 5))->isTrue()699 ->boolean($previousCalls = $calls->hasPreviousEqualTo($call4, 5))->isTrue()700 ;701 }702 public function testHasPreviousIdenticalTo()703 {704 $this705 ->if($calls = new testedClass())706 ->then707 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()708 ->if($calls[] = $call1 = new adapter\call(uniqid()))709 ->then710 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()711 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call($call1), 0))->isFalse()712 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call($call1), 1))->isFalse()713 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))->isFalse()714 ->if($calls[] = $call2 = new adapter\call(uniqid(), []))715 ->then716 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call(uniqid()), 1))->isFalse()717 ->boolean($calls->hasPreviousIdenticalTo($call1, 1))->isFalse()718 ->boolean($previousCalls = $calls->hasPreviousIdenticalTo($call1, 2))->isTrue()719 ->boolean($calls->hasPreviousIdenticalTo($call2, 1))->isFalse()720 ->boolean($calls->hasPreviousIdenticalTo($call2, 2))->isFalse()721 ->if($calls[] = $call3 = new adapter\call(uniqid(), [$object = new \mock\phpObject()]))722 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), [clone $object]))723 ->and($calls[] = $call5 = new adapter\call(uniqid(), []))724 ->then725 ->boolean($calls->hasPreviousIdenticalTo(new adapter\call(uniqid()), 1))->isFalse()726 ->boolean($calls->hasPreviousIdenticalTo($call1, 1))->isFalse()727 ->boolean($previousCalls = $calls->hasPreviousIdenticalTo($call1, 2))->isTrue()728 ->boolean($calls->hasPreviousIdenticalTo($call2, 1))->isFalse()729 ->boolean($calls->hasPreviousIdenticalTo($call2, 2))->isFalse()730 ->boolean($previousCalls = $calls->hasPreviousIdenticalTo($call3, 4))->isTrue()731 ->boolean($calls->hasPreviousIdenticalTo($call4, 4))->isFalse()732 ->boolean($previousCalls = $calls->hasPreviousIdenticalTo($call3, 5))->isTrue()733 ->boolean($previousCalls =$calls->hasPreviousIdenticalTo($call4, 5))->isTrue()734 ;735 }736 public function testHasPrevious()737 {738 $this739 ->if($calls = new mockedTestedClass())740 ->then741 ->boolean($calls->hasPrevious($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX)))->isFalse()742 ->mock($calls)->call('hasPreviousEqualTo')->withArguments($call, $position)->once()743 ->boolean($calls->hasPrevious($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX), true))->isFalse()744 ->mock($calls)->call('hasPreviousIdenticalTo')->withArguments($call, $position)->once()745 ;746 }747 public function testGetAfterEqualTo()748 {749 $this750 ->if($calls = new testedClass())751 ->then752 ->object($calls->getAfterEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))753 ->isInstanceOf(atoum\test\adapter\calls::class)754 ->hasSize(0)755 ->if($calls[] = $call1 = new adapter\call(uniqid()))756 ->then757 ->object($calls->getAfterEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))758 ->isInstanceOf(atoum\test\adapter\calls::class)759 ->hasSize(0)760 ->object($calls->getAfterEqualTo(new adapter\call($call1), 0))761 ->isInstanceOf(atoum\test\adapter\calls::class)762 ->hasSize(0)763 ->object($calls->getAfterEqualTo(new adapter\call($call1), 1))764 ->isInstanceOf(atoum\test\adapter\calls::class)765 ->hasSize(0)766 ->object($calls->getAfterEqualTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))767 ->isInstanceOf(atoum\test\adapter\calls::class)768 ->hasSize(0)769 ->if($calls[] = $call2 = new adapter\call(uniqid(), []))770 ->then771 ->object($calls->getAfterEqualTo(new adapter\call(uniqid()), 1))772 ->isInstanceOf(atoum\test\adapter\calls::class)773 ->hasSize(0)774 ->object($calls->getAfterEqualTo($call1, 1))775 ->isInstanceOf(atoum\test\adapter\calls::class)776 ->hasSize(0)777 ->object($calls->getAfterEqualTo($call1, 2))778 ->isInstanceOf(atoum\test\adapter\calls::class)779 ->hasSize(0)780 ->object($afterCalls = $calls->getAfterEqualTo($call2, 1))781 ->isInstanceOf(atoum\test\adapter\calls::class)782 ->hasSize(1)783 ->array($afterCalls->toArray())784 ->isEqualTo([2 => $call2])785 ->object($calls->getAfterEqualTo($call2, 2))786 ->isInstanceOf(atoum\test\adapter\calls::class)787 ->hasSize(0)788 ->if($calls[] = $call3 = new adapter\call(uniqid(), [$object = new \mock\phpObject()]))789 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), [clone $object]))790 ->and($calls[] = $call5 = new adapter\call(uniqid(), []))791 ->then792 ->object($calls->getAfterEqualTo(new adapter\call(uniqid()), 1))793 ->isInstanceOf(atoum\test\adapter\calls::class)794 ->hasSize(0)795 ->object($calls->getAfterEqualTo($call1, 1))796 ->isInstanceOf(atoum\test\adapter\calls::class)797 ->hasSize(0)798 ->object($calls->getAfterEqualTo($call1, 2))799 ->isInstanceOf(atoum\test\adapter\calls::class)800 ->hasSize(0)801 ->object($afterCalls = $calls->getAfterEqualTo($call2, 1))802 ->isInstanceOf(atoum\test\adapter\calls::class)803 ->hasSize(1)804 ->array($afterCalls->toArray())805 ->isEqualTo([2 => $call2])806 ->object($calls->getAfterEqualTo($call2, 2))807 ->isInstanceOf(atoum\test\adapter\calls::class)808 ->hasSize(0)809 ->object($afterCalls = $calls->getAfterEqualTo($call3, 1))810 ->isInstanceOf(atoum\test\adapter\calls::class)811 ->hasSize(2)812 ->array($afterCalls->toArray())813 ->isEqualTo([3 => $call3, 4 => $call4])814 ->object($afterCalls = $calls->getAfterEqualTo($call3, 3))815 ->isInstanceOf(atoum\test\adapter\calls::class)816 ->hasSize(1)817 ->array($afterCalls->toArray())818 ->isEqualTo([4 => $call4])819 ->object($afterCalls = $calls->getAfterEqualTo($call4, 1))820 ->isInstanceOf(atoum\test\adapter\calls::class)821 ->hasSize(2)822 ->array($afterCalls->toArray())823 ->isEqualTo([3 => $call3, 4 => $call4])824 ;825 }826 public function testGetAfterIdenticalTo()827 {828 $this829 ->if($calls = new testedClass())830 ->then831 ->object($calls->getAfterIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))832 ->isInstanceOf(atoum\test\adapter\calls::class)833 ->hasSize(0)834 ->if($calls[] = $call1 = new adapter\call(uniqid()))835 ->then836 ->object($calls->getAfterIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))837 ->isInstanceOf(atoum\test\adapter\calls::class)838 ->hasSize(0)839 ->object($calls->getAfterIdenticalTo(new adapter\call($call1), 0))840 ->isInstanceOf(atoum\test\adapter\calls::class)841 ->hasSize(0)842 ->object($calls->getAfterIdenticalTo(new adapter\call($call1), 1))843 ->isInstanceOf(atoum\test\adapter\calls::class)844 ->hasSize(0)845 ->object($calls->getAfterIdenticalTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))846 ->isInstanceOf(atoum\test\adapter\calls::class)847 ->hasSize(0)848 ->if($calls[] = $call2 = new adapter\call(uniqid(), []))849 ->then850 ->object($calls->getAfterIdenticalTo(new adapter\call(uniqid()), 1))851 ->isInstanceOf(atoum\test\adapter\calls::class)852 ->hasSize(0)853 ->object($calls->getAfterIdenticalTo($call1, 1))854 ->isInstanceOf(atoum\test\adapter\calls::class)855 ->hasSize(0)856 ->object($calls->getAfterIdenticalTo($call1, 2))857 ->isInstanceOf(atoum\test\adapter\calls::class)858 ->hasSize(0)859 ->object($afterCalls = $calls->getAfterIdenticalTo($call2, 1))860 ->isInstanceOf(atoum\test\adapter\calls::class)861 ->hasSize(1)862 ->array($afterCalls->toArray())863 ->isIdenticalTo([2 => $call2])864 ->object($calls->getAfterIdenticalTo($call2, 2))865 ->isInstanceOf(atoum\test\adapter\calls::class)866 ->hasSize(0)867 ->if($calls[] = $call3 = new adapter\call(uniqid(), [$object = new \mock\phpObject()]))868 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), [clone $object]))869 ->and($calls[] = $call5 = new adapter\call(uniqid(), []))870 ->then871 ->object($calls->getAfterIdenticalTo(new adapter\call(uniqid()), 1))872 ->isInstanceOf(atoum\test\adapter\calls::class)873 ->hasSize(0)874 ->object($calls->getAfterIdenticalTo($call1, 1))875 ->isInstanceOf(atoum\test\adapter\calls::class)876 ->hasSize(0)877 ->object($calls->getAfterIdenticalTo($call1, 2))878 ->isInstanceOf(atoum\test\adapter\calls::class)879 ->hasSize(0)880 ->object($afterCalls = $calls->getAfterIdenticalTo($call2, 1))881 ->isInstanceOf(atoum\test\adapter\calls::class)882 ->hasSize(1)883 ->array($afterCalls->toArray())884 ->isIdenticalTo([2 => $call2])885 ->object($calls->getAfterIdenticalTo($call2, 2))886 ->isInstanceOf(atoum\test\adapter\calls::class)887 ->hasSize(0)888 ->object($afterCalls = $calls->getAfterIdenticalTo($call3, 1))889 ->isInstanceOf(atoum\test\adapter\calls::class)890 ->hasSize(1)891 ->array($afterCalls->toArray())892 ->isIdenticalTo([3 => $call3])893 ->object($afterCalls = $calls->getAfterIdenticalTo($call3, 3))894 ->isInstanceOf(atoum\test\adapter\calls::class)895 ->hasSize(0)896 ->object($afterCalls = $calls->getAfterIdenticalTo($call4, 1))897 ->isInstanceOf(atoum\test\adapter\calls::class)898 ->hasSize(1)899 ->array($afterCalls->toArray())900 ->isIdenticalTo([4 => $call4])901 ;902 }903 public function testGetAfter()904 {905 $this906 ->if($calls = new mockedTestedClass())907 ->then908 ->object($calls->getAfter($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX)))909 ->isInstanceOf(atoum\test\adapter\calls::class)910 ->mock($calls)->call('getAfterEqualTo')->withArguments($call, $position)->once()911 ->object($calls->getAfter($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX), true))912 ->isInstanceOf(atoum\test\adapter\calls::class)913 ->mock($calls)->call('getAfterIdenticalTo')->withArguments($call, $position)->once()914 ;915 }916 public function testHasAfterEqualTo()917 {918 $this919 ->if($calls = new testedClass())920 ->then921 ->boolean($calls->hasAfterEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()922 ->if($calls[] = $call1 = new adapter\call(uniqid()))923 ->then924 ->boolean($calls->hasAfterEqualTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()925 ->boolean($calls->hasAfterEqualTo(new adapter\call($call1), 0))->isFalse()926 ->boolean($calls->hasAfterEqualTo(new adapter\call($call1), 1))->isFalse()927 ->boolean($calls->hasAfterEqualTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))->isFalse()928 ->if($calls[] = $call2 = new adapter\call(uniqid(), []))929 ->then930 ->boolean($calls->hasAfterEqualTo(new adapter\call(uniqid()), 1))->isFalse()931 ->boolean($calls->hasAfterEqualTo($call1, 1))->isFalse()932 ->boolean($calls->hasAfterEqualTo($call1, 2))->isFalse()933 ->boolean($afterCalls = $calls->hasAfterEqualTo($call2, 1))->isTrue()934 ->boolean($calls->hasAfterEqualTo($call2, 2))->isFalse()935 ->if($calls[] = $call3 = new adapter\call(uniqid(), [$object = new \mock\phpObject()]))936 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), [clone $object]))937 ->and($calls[] = $call5 = new adapter\call(uniqid(), []))938 ->then939 ->boolean($calls->hasAfterEqualTo(new adapter\call(uniqid()), 1))->isFalse()940 ->boolean($calls->hasAfterEqualTo($call1, 1))->isFalse()941 ->boolean($calls->hasAfterEqualTo($call1, 2))->isFalse()942 ->boolean($afterCalls = $calls->hasAfterEqualTo($call2, 1))->isTrue()943 ->boolean($calls->hasAfterEqualTo($call2, 2))->isFalse()944 ->boolean($afterCalls = $calls->hasAfterEqualTo($call3, 1))->isTrue()945 ->boolean($afterCalls = $calls->hasAfterEqualTo($call3, 3))->isTrue()946 ->boolean($afterCalls = $calls->hasAfterEqualTo($call4, 1))->isTrue()947 ;948 }949 public function testHasAfterIdenticalTo()950 {951 $this952 ->if($calls = new testedClass())953 ->then954 ->boolean($calls->hasAfterIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()955 ->if($calls[] = $call1 = new adapter\call(uniqid()))956 ->then957 ->boolean($calls->hasAfterIdenticalTo(new adapter\call(uniqid()), rand(1, PHP_INT_MAX)))->isFalse()958 ->boolean($calls->hasAfterIdenticalTo(new adapter\call($call1), 0))->isFalse()959 ->boolean($calls->hasAfterIdenticalTo(new adapter\call($call1), 1))->isFalse()960 ->boolean($calls->hasAfterIdenticalTo(new adapter\call($call1), rand(2, PHP_INT_MAX)))->isFalse()961 ->if($calls[] = $call2 = new adapter\call(uniqid(), []))962 ->then963 ->boolean($calls->hasAfterIdenticalTo(new adapter\call(uniqid()), 1))->isFalse()964 ->boolean($calls->hasAfterIdenticalTo($call1, 1))->isFalse()965 ->boolean($calls->hasAfterIdenticalTo($call1, 2))->isFalse()966 ->boolean($afterCalls = $calls->hasAfterIdenticalTo($call2, 1))->isTrue()967 ->boolean($calls->hasAfterIdenticalTo($call2, 2))->isFalse()968 ->if($calls[] = $call3 = new adapter\call(uniqid(), [$object = new \mock\phpObject()]))969 ->if($calls[] = $call4 = new adapter\call($call3->getFunction(), [clone $object]))970 ->and($calls[] = $call5 = new adapter\call(uniqid(), []))971 ->then972 ->boolean($calls->hasAfterIdenticalTo(new adapter\call(uniqid()), 1))->isFalse()973 ->boolean($calls->hasAfterIdenticalTo($call1, 1))->isFalse()974 ->boolean($calls->hasAfterIdenticalTo($call1, 2))->isFalse()975 ->boolean($afterCalls = $calls->hasAfterIdenticalTo($call2, 1))->isTrue()976 ->boolean($calls->hasAfterIdenticalTo($call2, 2))->isFalse()977 ->boolean($afterCalls = $calls->hasAfterIdenticalTo($call3, 1))->isTrue()978 ->boolean($afterCalls = $calls->hasAfterIdenticalTo($call3, 3))->isFalse()979 ->boolean($afterCalls = $calls->hasAfterIdenticalTo($call4, 1))->isTrue()980 ;981 }982 public function testHasAfter()983 {984 $this985 ->if($calls = new mockedTestedClass())986 ->then987 ->boolean($calls->hasAfter($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX)))->isFalse()988 ->mock($calls)->call('hasAfterEqualTo')->withArguments($call, $position)->once()989 ->boolean($calls->hasAfter($call = new adapter\call(uniqid()), $position = rand(1, PHP_INT_MAX), true))->isFalse()990 ->mock($calls)->call('hasAfterIdenticalTo')->withArguments($call, $position)->once()991 ;992 }993 public function testGet()994 {995 $this996 ->if($calls = new testedClass())997 ->then998 ->object($calls->get(new adapter\call(uniqid())))999 ->isInstanceOf(atoum\test\adapter\calls::class)1000 ->hasSize(0)1001 ->if($calls[] = $call1 = new adapter\call(uniqid()))1002 ->then1003 ->object($calls->get(new adapter\call(uniqid())))1004 ->isInstanceOf(atoum\test\adapter\calls::class)1005 ->hasSize(0)1006 ->object($calls->get($call1))1007 ->isInstanceOf(atoum\test\adapter\calls::class)1008 ->hasSize(1)1009 ->array($calls->get($call1)->toArray())1010 ->isEqualTo([1 => $call1])1011 ->if($calls[] = $call2 = new adapter\call($call1->getFunction(), []))1012 ->then1013 ->object($calls->get(new adapter\call(uniqid())))1014 ->isInstanceOf(atoum\test\adapter\calls::class)1015 ->hasSize(0)1016 ->object($calls->get($call1))1017 ->isInstanceOf(atoum\test\adapter\calls::class)1018 ->hasSize(2)1019 ->array($calls->get($call1)->toArray())1020 ->isEqualTo([1 => $call1, 2 => $call2])1021 ->object($calls->get($call2))1022 ->isInstanceOf(atoum\test\adapter\calls::class)1023 ->hasSize(1)1024 ->array($calls->get($call2)->toArray())1025 ->isEqualTo([2 => $call2])1026 ->if($calls[] = $call3 = new adapter\call($call1->getFunction(), [$object = new \mock\phpObject()]))1027 ->then1028 ->object($calls->get(new adapter\call(uniqid())))1029 ->isInstanceOf(atoum\test\adapter\calls::class)1030 ->hasSize(0)1031 ->object($calls->get($call1))1032 ->isInstanceOf(atoum\test\adapter\calls::class)1033 ->hasSize(3)1034 ->array($calls->get($call1)->toArray())1035 ->isEqualTo([1 => $call1, 2 => $call2, 3 => $call3])1036 ->object($calls->get($call2))1037 ->isInstanceOf(atoum\test\adapter\calls::class)1038 ->hasSize(1)1039 ->array($calls->get($call2)->toArray())1040 ->isEqualTo([2 => $call2])1041 ->object($calls->get($call3))1042 ->isInstanceOf(atoum\test\adapter\calls::class)1043 ->hasSize(1)1044 ->array($calls->get($call3)->toArray())1045 ->isEqualTo([3 => $call3])1046 ->if($calls[] = $call4 = new adapter\call($call1->getFunction(), [$object = new \mock\phpObject(), $arg = uniqid()]))1047 ->then1048 ->object($calls->get(new adapter\call(uniqid())))1049 ->isInstanceOf(atoum\test\adapter\calls::class)1050 ->hasSize(0)1051 ->object($calls->get($call1))1052 ->isInstanceOf(atoum\test\adapter\calls::class)1053 ->hasSize(4)1054 ->array($calls->get($call1)->toArray())1055 ->isEqualTo([1 => $call1, 2 => $call2, 3 => $call3, 4 => $call4])1056 ->object($calls->get($call2))1057 ->isInstanceOf(atoum\test\adapter\calls::class)1058 ->hasSize(1)1059 ->array($calls->get($call2)->toArray())1060 ->isEqualTo([2 => $call2])1061 ->object($calls->get($call3))1062 ->isInstanceOf(atoum\test\adapter\calls::class)1063 ->hasSize(2)1064 ->array($calls->get($call3)->toArray())1065 ->isEqualTo([3 => $call3, 4 => $call4])1066 ->object($calls->get(new adapter\call($call1->getFunction(), [clone $object])))1067 ->isInstanceOf(atoum\test\adapter\calls::class)1068 ->hasSize(2)1069 ->array($calls->get($call3)->toArray())1070 ->isEqualTo([3 => $call3, 4 => $call4])1071 ->object($calls->get($call4))1072 ->isInstanceOf(atoum\test\adapter\calls::class)1073 ->hasSize(1)1074 ->array($calls->get($call4)->toArray())1075 ->isEqualTo([4 => $call4])1076 ->object($calls->get(new adapter\call($call1->getFunction(), [clone $object, $arg])))1077 ->isInstanceOf(atoum\test\adapter\calls::class)1078 ->hasSize(1)1079 ->array($calls->get($call4)->toArray())1080 ->isEqualTo([4 => $call4])1081 ->if($calls = new testedClass())1082 ->then1083 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))1084 ->isInstanceOf(atoum\test\adapter\calls::class)1085 ->hasSize(0)1086 ->if($calls[] = $call5 = new adapter\call(uniqid()))1087 ->then1088 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))1089 ->isInstanceOf(atoum\test\adapter\calls::class)1090 ->hasSize(0)1091 ->object($calls->getIdenticalTo($call5))1092 ->isInstanceOf(atoum\test\adapter\calls::class)1093 ->hasSize(1)1094 ->array($calls->getIdenticalTo($call5)->toArray())1095 ->isEqualTo([5 => $call5])1096 ->if($calls[] = $call6 = new adapter\call($call5->getFunction(), []))1097 ->then1098 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))1099 ->isInstanceOf(atoum\test\adapter\calls::class)1100 ->hasSize(0)1101 ->object($calls->getIdenticalTo($call5))1102 ->isInstanceOf(atoum\test\adapter\calls::class)1103 ->hasSize(2)1104 ->array($calls->getIdenticalTo($call5)->toArray())1105 ->isEqualTo([5 => $call5, 6 => $call6])1106 ->object($calls->getIdenticalTo($call6))1107 ->isInstanceOf(atoum\test\adapter\calls::class)1108 ->hasSize(1)1109 ->array($calls->getIdenticalTo($call6)->toArray())1110 ->isEqualTo([6 => $call6])1111 ->if($calls[] = $call7 = new adapter\call($call5->getFunction(), [$object = new \mock\phpObject()]))1112 ->then1113 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))1114 ->isInstanceOf(atoum\test\adapter\calls::class)1115 ->hasSize(0)1116 ->object($calls->getIdenticalTo($call5))1117 ->isInstanceOf(atoum\test\adapter\calls::class)1118 ->hasSize(3)1119 ->array($calls->getIdenticalTo($call5)->toArray())1120 ->isEqualTo([5 => $call5, 6 => $call6, 7 => $call7])1121 ->object($calls->getIdenticalTo($call6))1122 ->isInstanceOf(atoum\test\adapter\calls::class)1123 ->hasSize(1)1124 ->array($calls->getIdenticalTo($call6)->toArray())1125 ->isEqualTo([6 => $call6])1126 ->object($calls->getIdenticalTo($call7))1127 ->isInstanceOf(atoum\test\adapter\calls::class)1128 ->hasSize(1)1129 ->array($calls->getIdenticalTo($call7)->toArray())1130 ->isEqualTo([7 => $call7])1131 ->object($calls->getIdenticalTo(new adapter\call($call5->getFunction(), [clone $object])))1132 ->isInstanceOf(atoum\test\adapter\calls::class)1133 ->hasSize(0)1134 ->if($calls[] = $call8 = new adapter\call($call5->getFunction(), [$object = new \mock\phpObject(), $arg = uniqid()]))1135 ->then1136 ->object($calls->getIdenticalTo(new adapter\call(uniqid())))1137 ->isInstanceOf(atoum\test\adapter\calls::class)1138 ->hasSize(0)1139 ->object($calls->getIdenticalTo($call5))1140 ->isInstanceOf(atoum\test\adapter\calls::class)1141 ->hasSize(4)1142 ->array($calls->getIdenticalTo($call5)->toArray())1143 ->isEqualTo([5 => $call5, 6 => $call6, 7 => $call7, 8 => $call8])1144 ->object($calls->getIdenticalTo($call6))1145 ->isInstanceOf(atoum\test\adapter\calls::class)1146 ->hasSize(1)1147 ->array($calls->getIdenticalTo($call6)->toArray())1148 ->isEqualTo([6 => $call6])1149 ->object($calls->getIdenticalTo($call7))1150 ->isInstanceOf(atoum\test\adapter\calls::class)1151 ->hasSize(1)1152 ->array($calls->getIdenticalTo($call7)->toArray())1153 ->isEqualTo([7 => $call7])1154 ->object($calls->getIdenticalTo(new adapter\call($call5->getFunction(), [clone $object])))1155 ->isInstanceOf(atoum\test\adapter\calls::class)1156 ->hasSize(0)1157 ->object($calls->getIdenticalTo($call8))1158 ->isInstanceOf(atoum\test\adapter\calls::class)1159 ->hasSize(1)1160 ->array($calls->getIdenticalTo($call8)->toArray())1161 ->isEqualTo([8 => $call8])1162 ->object($calls->getIdenticalTo(new adapter\call($call1->getFunction(), [clone $object, $arg])))1163 ->isInstanceOf(atoum\test\adapter\calls::class)1164 ->hasSize(0)1165 ;1166 }1167 public function testGetTimeline()1168 {1169 $this1170 ->if($calls = new testedClass())1171 ->then1172 ->array($calls->getTimeline())->isEmpty()1173 ->if($calls[] = $call1 = new adapter\call(uniqid()))1174 ->then1175 ->array($calls->getTimeline())->isEqualTo([1 => $call1])1176 ->if($calls[] = $call2 = new adapter\call(uniqid()))1177 ->then1178 ->array($calls->getTimeline())->isEqualTo(1179 [1180 1 => $call1,1181 2 => $call21182 ]1183 )1184 ->if($otherCalls = new testedClass())1185 ->and($otherCalls[] = $call3 = new adapter\call(uniqid()))1186 ->then1187 ->array($calls->getTimeline())->isEqualTo(1188 [1189 1 => $call1,1190 2 => $call21191 ]1192 )1193 ->if($calls[] = $call4 = new adapter\call(uniqid()))1194 ->then1195 ->array($calls->getTimeline())->isEqualTo(1196 [1197 1 => $call1,1198 2 => $call2,1199 4 => $call41200 ]1201 )1202 ;1203 }1204}...
call.php
Source:call.php
1<?php2namespace mageekguy\atoum\tests\units\test\adapter;3require_once __DIR__ . '/../../../runner.php';4use mageekguy\atoum;5use mageekguy\atoum\test\adapter\call as testedClass;6use mageekguy\atoum\test\adapter\call\decorator;7class call extends atoum\test8{9 public function test__construct()10 {11 $this12 ->if($call = new testedClass())13 ->then14 ->variable($call->getFunction())->isNull()15 ->variable($call->getArguments())->isNull()16 ->object($call->getDecorator())->isEqualTo(new decorator())17 ->if($call = new testedClass($function = uniqid()))18 ->then19 ->string($call->getFunction())->isEqualTo($function)20 ->variable($call->getArguments())->isNull()21 ->object($call->getDecorator())->isEqualTo(new decorator())22 ->if($call = new testedClass($function = uniqid(), $arguments = []))23 ->then24 ->string($call->getFunction())->isEqualTo($function)25 ->array($call->getArguments())->isEqualTo($arguments)26 ->object($call->getDecorator())->isEqualTo(new decorator())27 ->if($call = new testedClass('MD5'))28 ->then29 ->string($call->getFunction())->isEqualTo('MD5')30 ->variable($call->getArguments())->isNull()31 ->object($call->getDecorator())->isEqualTo(new decorator())32 ->exception(function () {33 new testedClass('');34 })35 ->isInstanceOf(atoum\exceptions\logic\invalidArgument::class)36 ->hasMessage('Function must not be empty')37 ;38 }39 public function test__toString()40 {41 $this42 ->if($call = new testedClass())43 ->then44 ->castToString($call)->isEmpty()45 ;46 }47 public function testIsFullyQualified()48 {49 $this50 ->if($call = new testedClass())51 ->then52 ->boolean($call->isFullyQualified())->isFalse()53 ->if($call = new testedClass(uniqid()))54 ->then55 ->boolean($call->isFullyQualified())->isFalse()56 ->if($call = new testedClass(null, []))57 ->then58 ->boolean($call->isFullyQualified())->isFalse()59 ->if($call = new testedClass(uniqid(), []))60 ->then61 ->boolean($call->isFullyQualified())->isTrue()62 ;63 }64 public function testSetFunction()65 {66 $this67 ->if($call = new testedClass())68 ->then69 ->object($call->setFunction($function = uniqid()))->isIdenticalTo($call)70 ->string($call->getFunction())->isEqualTo($function)71 ->object($call->setFunction('foo'))->isIdenticalTo($call)72 ->string($call->getFunction())->isEqualTo('foo')73 ->object($call->setFunction('FOo'))->isIdenticalTo($call)74 ->string($call->getFunction())->isEqualTo('FOo')75 ;76 }77 public function testSetArguments()78 {79 $this80 ->if($call = new testedClass())81 ->then82 ->object($call->setArguments($arguments = []))->isIdenticalTo($call)83 ->array($call->getArguments())->isEqualTo($arguments)84 ;85 }86 public function testUnsetArguments()87 {88 $this89 ->if($call = new testedClass())90 ->then91 ->object($call->unsetArguments())->isIdenticalTo($call)92 ->variable($call->getArguments())->isNull()93 ->if($call->setArguments([]))94 ->then95 ->object($call->unsetArguments())->isIdenticalTo($call)96 ->variable($call->getArguments())->isNull()97 ;98 }99 public function testSetDecorator()100 {101 $this102 ->if($call = new testedClass())103 ->then104 ->object($call->setDecorator($decorator = new decorator()))->isIdenticalTo($call)105 ->object($call->getDecorator())->isIdenticalTo($decorator)106 ->object($call->setDecorator())->isIdenticalTo($call)107 ->object($call->getDecorator())108 ->isNotIdenticalTo($decorator)109 ->isEqualTo(new decorator())110 ;111 }112 public function testIsEqualTo()113 {114 $this115 ->if($call1 = new testedClass())116 ->and($call2 = new testedClass())117 ->then118 ->boolean($call1->isEqualTo($call2))->isFalse()119 ->boolean($call2->isEqualTo($call1))->isFalse()120 ->if($call1 = new testedClass(uniqid()))121 ->then122 ->boolean($call1->isEqualTo($call2))->isFalse()123 ->boolean($call2->isEqualTo($call1))->isFalse()124 ->if($call2 = new testedClass(uniqid()))125 ->then126 ->boolean($call1->isEqualTo($call2))->isFalse()127 ->boolean($call2->isEqualTo($call1))->isFalse()128 ->if($call1 = new testedClass())129 ->then130 ->boolean($call1->isEqualTo($call2))->isFalse()131 ->boolean($call2->isEqualTo($call1))->isFalse()132 ->if($call1 = new testedClass($function = uniqid()))133 ->and($call2 = new testedClass($function))134 ->then135 ->boolean($call1->isEqualTo($call2))->isTrue()136 ->boolean($call2->isEqualTo($call1))->isTrue()137 ->if($call2 = new testedClass(strtoupper($function)))138 ->then139 ->boolean($call1->isEqualTo($call2))->isTrue()140 ->boolean($call2->isEqualTo($call1))->isTrue()141 ->if($call1 = new testedClass($function, []))142 ->then143 ->boolean($call1->isEqualTo($call2))->isFalse()144 ->boolean($call2->isEqualTo($call1))->isTrue()145 ->if($call2 = new testedClass($function, []))146 ->then147 ->boolean($call1->isEqualTo($call2))->isTrue()148 ->boolean($call2->isEqualTo($call1))->isTrue()149 ->if($call1 = new testedClass($function, [$argument = uniqid()]))150 ->then151 ->boolean($call1->isEqualTo($call2))->isFalse()152 ->boolean($call2->isEqualTo($call1))->isFalse()153 ->if($call2 = new testedClass($function, [$argument]))154 ->then155 ->boolean($call1->isEqualTo($call2))->isTrue()156 ->boolean($call2->isEqualTo($call1))->isTrue()157 ->if($call1 = new testedClass($function, $arguments = [uniqid(), uniqid()]))158 ->then159 ->boolean($call1->isEqualTo($call2))->isFalse()160 ->boolean($call2->isEqualTo($call1))->isFalse()161 ->if($call2 = new testedClass($function, $arguments))162 ->then163 ->boolean($call1->isEqualTo($call2))->isTrue()164 ->boolean($call2->isEqualTo($call1))->isTrue()165 ->if($call1 = new testedClass($function, $arguments = [$arg1 = uniqid(), $arg2 = uniqid(), $arg3 = new \mock\phpObject()]))166 ->then167 ->boolean($call1->isEqualTo($call2))->isFalse()168 ->boolean($call2->isEqualTo($call1))->isFalse()169 ->if($call2 = new testedClass($function, $arguments))170 ->then171 ->boolean($call1->isEqualTo($call2))->isTrue()172 ->boolean($call2->isEqualTo($call1))->isTrue()173 ->if($call2 = new testedClass($function, [$arg1, $arg2, clone $arg3]))174 ->then175 ->boolean($call1->isEqualTo($call2))->isTrue()176 ->boolean($call2->isEqualTo($call1))->isTrue()177 ->if($call2 = new testedClass($function, [$arg3, $arg2, $arg1]))178 ->then179 ->boolean($call1->isEqualTo($call2))->isFalse()180 ->boolean($call2->isEqualTo($call1))->isFalse()181 ->if($call1 = new testedClass($function = uniqid(), [$arg1 = uniqid(), $arg2 = uniqid(), $arg3 = new \mock\phpObject()]))182 ->and($call2 = new testedClass($function, [$arg1, $arg2]))183 ->then184 ->boolean($call1->isEqualTo($call2))->isFalse()185 ->boolean($call2->isEqualTo($call1))->isTrue()186 ->if($call1 = new testedClass($function))187 ->and($call2 = new testedClass($function, [$object = new \mock\phpObject()]))188 ->then189 ->boolean($call1->isEqualTo($call2))->isTrue()190 ->boolean($call2->isEqualTo($call1))->isFalse()191 ;192 }193 public function testIsIdenticalTo()194 {195 $this196 ->if($call1 = new testedClass())197 ->and($call2 = new testedClass())198 ->then199 ->boolean($call1->isIdenticalTo($call2))->isFalse()200 ->boolean($call2->isIdenticalTo($call1))->isFalse()201 ->if($call1 = new testedClass(uniqid()))202 ->then203 ->boolean($call1->isIdenticalTo($call2))->isFalse()204 ->boolean($call2->isIdenticalTo($call1))->isFalse()205 ->if($call2 = new testedClass(uniqid()))206 ->then207 ->boolean($call1->isIdenticalTo($call2))->isFalse()208 ->boolean($call2->isIdenticalTo($call1))->isFalse()209 ->if($call1 = new testedClass())210 ->then211 ->boolean($call1->isIdenticalTo($call2))->isFalse()212 ->boolean($call2->isIdenticalTo($call1))->isFalse()213 ->if($call1 = new testedClass($function = uniqid()))214 ->and($call2 = new testedClass($function))215 ->then216 ->boolean($call1->isIdenticalTo($call2))->isTrue()217 ->boolean($call2->isIdenticalTo($call1))->isTrue()218 ->if($call1 = new testedClass($function, []))219 ->then220 ->boolean($call1->isIdenticalTo($call2))->isFalse()221 ->boolean($call2->isIdenticalTo($call1))->isTrue()222 ->if($call2 = new testedClass($function, []))223 ->then224 ->boolean($call1->isIdenticalTo($call2))->isTrue()225 ->boolean($call2->isIdenticalTo($call1))->isTrue()226 ->if($call1 = new testedClass($function, [$argument = uniqid()]))227 ->then228 ->boolean($call1->isIdenticalTo($call2))->isFalse()229 ->boolean($call2->isIdenticalTo($call1))->isFalse()230 ->if($call2 = new testedClass($function, [$argument]))231 ->then232 ->boolean($call1->isIdenticalTo($call2))->isTrue()233 ->boolean($call2->isIdenticalTo($call1))->isTrue()234 ->if($call1 = new testedClass($function, $arguments = [uniqid(), uniqid()]))235 ->then236 ->boolean($call1->isIdenticalTo($call2))->isFalse()237 ->boolean($call2->isIdenticalTo($call1))->isFalse()238 ->if($call2 = new testedClass($function, $arguments))239 ->then240 ->boolean($call1->isIdenticalTo($call2))->isTrue()241 ->boolean($call2->isIdenticalTo($call1))->isTrue()242 ->if($call1 = new testedClass($function, $arguments = [$arg1 = uniqid(), $arg2 = uniqid(), $arg3 = new \mock\phpObject()]))243 ->then244 ->boolean($call1->isIdenticalTo($call2))->isFalse()245 ->boolean($call2->isIdenticalTo($call1))->isFalse()246 ->if($call2 = new testedClass($function, $arguments))247 ->then248 ->boolean($call1->isIdenticalTo($call2))->isTrue()249 ->boolean($call2->isIdenticalTo($call1))->isTrue()250 ->if($call2 = new testedClass($function, [$arg1, $arg2, clone $arg3]))251 ->then252 ->boolean($call1->isIdenticalTo($call2))->isFalse()253 ->boolean($call2->isIdenticalTo($call1))->isFalse()254 ->if($call2 = new testedClass($function, [$arg3, $arg2, $arg1]))255 ->then256 ->boolean($call1->isIdenticalTo($call2))->isFalse()257 ->boolean($call2->isIdenticalTo($call1))->isFalse()258 ->if($call1 = new testedClass($function))259 ->and($call2 = new testedClass($function, [$object = new \mock\phpObject()]))260 ->then261 ->boolean($call1->isIdenticalTo($call2))->isTrue()262 ->boolean($call2->isIdenticalTo($call1))->isFalse()263 ;264 }265}...
identical
Using AI Code Generation
1require 'class.php';2$object = new class();3$object->method();4require 'class.php';5$object = new class();6$object->method();7require 'class.php';8$object = new class();9$object->method();10require 'class.php';11$object = new class();12$object->method();
identical
Using AI Code Generation
1$obj = new A();2$obj->test();3$obj = new A();4$obj->test();5$obj = new A();6$obj->test();7$obj = new A();8$obj->test();9$obj = new A();10$obj->test();11$obj = new A();12$obj->test();13$obj = new A();14$obj->test();15$obj = new A();16$obj->test();17$obj = new A();18$obj->test();19$obj = new A();20$obj->test();21$obj = new A();22$obj->test();23$obj = new A();24$obj->test();25$obj = new A();26$obj->test();27$obj = new A();28$obj->test();29$obj = new A();30$obj->test();31$obj = new A();32$obj->test();33$obj = new A();34$obj->test();35$obj = new A();
identical
Using AI Code Generation
1$test = new Test();2$test->test();3Test::test();4Test::test();5Test::test();6Test::test();7Test::test();8Test::test();9Test::test();10Test::test();11Test::test();12Test::test();13Test::test();14Test::test();15Test::test();16Test::test();17Test::test();18Test::test();19Test::test();20Test::test();21Test::test();22Test::test();23Test::test();24Test::test();25Test::test();
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Execute automation tests with identical on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.
Test now for FreeGet 100 minutes of automation test minutes FREE!!