How to use getExcludedClasses method of coverage class

Best Atoum code snippet using coverage.getExcludedClasses

coverage.php

Source:coverage.php Github

copy

Full Screen

...195 ->if($coverage = new testedClass())196 ->then197 ->array($coverage->getClasses())->isEmpty()198 ->array($coverage->getMethods())->isEmpty()199 ->array($coverage->getExcludedClasses())->isEmpty()200 ->array($coverage->getExcludedNamespaces())->isEmpty()201 ->array($coverage->getExcludedDirectories())->isEmpty()202 ->object($coverage->reset())->isIdenticalTo($coverage)203 ->array($coverage->getClasses())->isEmpty()204 ->array($coverage->getMethods())->isEmpty()205 ->array($coverage->getExcludedClasses())->isEmpty()206 ->array($coverage->getExcludedNamespaces())->isEmpty()207 ->array($coverage->getExcludedDirectories())->isEmpty()208 ->if($classController = new mock\controller())209 ->and($classController->disableMethodChecking())210 ->and($classController->__construct = function () {211 })212 ->and($classController->getName = function () use (& $className) {213 return $className;214 })215 ->and($classController->getFileName = function () use (& $classFile) {216 return $classFile;217 })218 ->and($classController->getTraits = [])219 ->and($classController->getStartLine = 1)220 ->and($classController->getEndLine = 12)221 ->and($class = new \mock\reflectionClass(uniqid(), $classController))222 ->and($methodController = new mock\controller())223 ->and($methodController->__construct = function () {224 })225 ->and($methodController->getName = function () use (& $methodName) {226 return $methodName;227 })228 ->and($methodController->isAbstract = false)229 ->and($methodController->getFileName = function () use (& $classFile) {230 return $classFile;231 })232 ->and($methodController->getDeclaringClass = function () use ($class) {233 return $class;234 })235 ->and($methodController->getStartLine = 6)236 ->and($methodController->getEndLine = 8)237 ->and($classController->getMethods = [new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)])238 ->and($classFile = uniqid())239 ->and($className = uniqid())240 ->and($methodName = uniqid())241 ->and($xdebugData = [242 $classFile =>243 [244 5 => 1,245 6 => 2,246 7 => 3,247 8 => 2,248 9 => 1249 ],250 uniqid() =>251 [252 5 => 2,253 6 => 3,254 7 => 4,255 8 => 3,256 9 => 2257 ]258 ]259 )260 ->and($coverage = new testedClass())261 ->and($coverage->setReflectionClassFactory(function () use ($class) {262 return $class;263 }))264 ->and($coverage->addXdebugDataForTest($this, $xdebugData))265 ->and($coverage->excludeClass($excludedClass =uniqid()))266 ->and($coverage->excludeNamespace($excludedNamespace= uniqid()))267 ->and($coverage->excludeDirectory($excludedDirectory = uniqid()))268 ->then269 ->array($coverage->getClasses())->isNotEmpty()270 ->array($coverage->getMethods())->isNotEmpty()271 ->array($coverage->getExcludedClasses())->isNotEmpty()272 ->array($coverage->getExcludedNamespaces())->isNotEmpty()273 ->array($coverage->getExcludedDirectories())->isNotEmpty()274 ->object($coverage->reset())->isIdenticalTo($coverage)275 ->array($coverage->getClasses())->isEmpty()276 ->array($coverage->getMethods())->isEmpty()277 ->array($coverage->getExcludedClasses())->isNotEmpty()278 ->array($coverage->getExcludedNamespaces())->isNotEmpty()279 ->array($coverage->getExcludedDirectories())->isNotEmpty()280 ;281 }282 public function testResetExcludedMethods()283 {284 $this285 ->if($coverage = new testedClass())286 ->then287 ->object($coverage->resetExcludedMethods())->isIdenticalTo($coverage)288 ->array($coverage->getExcludedMethods())->isEmpty()289 ->if($coverage->excludeMethod(uniqid()))290 ->then291 ->object($coverage->resetExcludedMethods())->isIdenticalTo($coverage)292 ->array($coverage->getExcludedMethods())->isEmpty()293 ;294 }295 public function testResetExcludedClasses()296 {297 $this298 ->if($coverage = new testedClass())299 ->then300 ->object($coverage->resetExcludedClasses())->isIdenticalTo($coverage)301 ->array($coverage->getExcludedClasses())->isEmpty()302 ->if($coverage->excludeClass(uniqid()))303 ->then304 ->object($coverage->resetExcludedClasses())->isIdenticalTo($coverage)305 ->array($coverage->getExcludedClasses())->isEmpty()306 ;307 }308 public function testResetExcludedNamespaces()309 {310 $this311 ->if($coverage = new testedClass())312 ->then313 ->object($coverage->resetExcludedNamespaces())->isIdenticalTo($coverage)314 ->array($coverage->getExcludedNamespaces())->isEmpty()315 ->if($coverage->excludeNamespace(uniqid()))316 ->then317 ->object($coverage->resetExcludedNamespaces())->isIdenticalTo($coverage)318 ->array($coverage->getExcludedNamespaces())->isEmpty()319 ;320 }321 public function testResetExcludedDirectories()322 {323 $this324 ->if($coverage = new testedClass())325 ->then326 ->object($coverage->resetExcludedDirectories())->isIdenticalTo($coverage)327 ->array($coverage->getExcludedDirectories())->isEmpty()328 ->if($coverage->excludeDirectory(uniqid()))329 ->then330 ->object($coverage->resetExcludedDirectories())->isIdenticalTo($coverage)331 ->array($coverage->getExcludedDirectories())->isEmpty()332 ;333 }334 public function testMerge()335 {336 $this337 ->if($classController = new mock\controller())338 ->and($classController->disableMethodChecking())339 ->and($classController->__construct = function () {340 })341 ->and($classController->getName = function () use (& $className) {342 return $className;343 })344 ->and($classController->getFileName = function () use (& $classFile) {345 return $classFile;346 })347 ->and($classController->getTraits = [])348 ->and($classController->getStartLine = 1)349 ->and($classController->getEndLine = 12)350 ->and($class = new \mock\reflectionClass(uniqid(), $classController))351 ->and($methodController = new mock\controller())352 ->and($methodController->__construct = function () {353 })354 ->and($methodController->getName = function () use (& $methodName) {355 return $methodName;356 })357 ->and($methodController->isAbstract = false)358 ->and($methodController->getFileName = function () use (& $classFile) {359 return $classFile;360 })361 ->and($methodController->getDeclaringClass = function () use ($class) {362 return $class;363 })364 ->and($methodController->getStartLine = 6)365 ->and($methodController->getEndLine = 8)366 ->and($method = new \mock\reflectionMethod(uniqid(), uniqid(), $methodController))367 ->and($classController->getMethod = function () use ($method) {368 return $method;369 })370 ->and($classController->getMethods = [$method])371 ->and($classFile = uniqid())372 ->and($className = uniqid())373 ->and($methodName = uniqid())374 ->and($xdebugData = [375 $classFile =>376 [377 5 => -2,378 6 => -1,379 7 => 1,380 8 => -2,381 9 =>-2382 ],383 uniqid() =>384 [385 5 => 2,386 6 => 3,387 7 => 4,388 8 => 3,389 9 => 2390 ]391 ]392 )393 ->and($coverage = new testedClass())394 ->and($coverage->setReflectionClassFactory(function () use ($class) {395 return $class;396 }))397 ->then398 ->object($coverage->merge($coverage))->isIdenticalTo($coverage)399 ->array($coverage->getClasses())->isEmpty()400 ->array($coverage->getMethods())->isEmpty()401 ->if($otherCoverage = new testedClass())402 ->then403 ->object($coverage->merge($otherCoverage))->isIdenticalTo($coverage)404 ->array($coverage->getClasses())->isEmpty()405 ->array($coverage->getMethods())->isEmpty()406 ->if($coverage->addXdebugDataForTest($this, $xdebugData))407 ->then408 ->object($coverage->merge($otherCoverage))->isIdenticalTo($coverage)409 ->array($coverage->getClasses())->isEqualTo([$className => $classFile])410 ->array($coverage->getMethods())->isEqualTo([411 $className => [412 $methodName => [413 6 => -1,414 7 => 1,415 8 => -2416 ]417 ]418 ]419 )420 ->object($coverage->merge($coverage))->isIdenticalTo($coverage)421 ->array($coverage->getClasses())->isEqualTo([$className => $classFile])422 ->array($coverage->getMethods())->isEqualTo([423 $className => [424 $methodName => [425 6 => -1,426 7 => 1,427 8 => -2428 ]429 ]430 ]431 )432 ->if($otherClassController = new mock\controller())433 ->and($otherClassController->disableMethodChecking())434 ->and($otherClassController->__construct = function () {435 })436 ->and($otherClassController->getName = function () use (& $otherClassName) {437 return $otherClassName;438 })439 ->and($otherClassController->getFileName = function () use (& $otherClassFile) {440 return $otherClassFile;441 })442 ->and($otherClassController->getTraits = [])443 ->and($otherClassController->getStartLine = 1)444 ->and($otherClassController->getEndLine = 12)445 ->and($otherClass = new \mock\reflectionClass($class, $otherClassController))446 ->and($otherMethodController = new mock\controller())447 ->and($otherMethodController->__construct = function () {448 })449 ->and($otherMethodController->getName = function () use (& $otherMethodName) {450 return $otherMethodName;451 })452 ->and($otherMethodController->isAbstract = false)453 ->and($otherMethodController->getFileName = function () use (& $otherClassFile) {454 return $otherClassFile;455 })456 ->and($otherMethodController->getDeclaringClass = function () use ($otherClass) {457 return $otherClass;458 })459 ->and($otherMethodController->getStartLine = 5)460 ->and($otherMethodController->getEndLine = 9)461 ->and($otherClassController->getMethods = [new \mock\reflectionMethod(uniqid(), uniqid(), $otherMethodController)])462 ->and($otherClassFile = uniqid())463 ->and($otherClassName = uniqid())464 ->and($otherMethodName = uniqid())465 ->and($otherXdebugData = [466 $otherClassFile =>467 [468 1 => -2,469 2 => -1,470 3 => 1,471 4 => 1,472 5 => -1,473 6 => 1,474 7 => 1,475 8 => -1,476 9 => -2,477 10 => 1478 ],479 uniqid() =>480 [481 500 => 200,482 600 => 300,483 700 => 400,484 800 => 300,485 900 => 200486 ]487 ]488 )489 ->and($otherCoverage->setReflectionClassFactory(function () use ($otherClass) {490 return $otherClass;491 }))492 ->then493 ->object($coverage->merge($otherCoverage->addXdebugDataForTest($this, $otherXdebugData)))->isIdenticalTo($coverage)494 ->array($coverage->getClasses())->isEqualTo([495 $className => $classFile,496 $otherClassName => $otherClassFile497 ]498 )499 ->array($coverage->getMethods())->isEqualTo([500 $className => [501 $methodName => [502 6 => -1,503 7 => 1,504 8 =>-2505 ]506 ],507 $otherClassName => [508 $otherMethodName => [509 5 => -1,510 6 => 1,511 7 => 1,512 8 => -1,513 9 => -2514 ]515 ]516 ]517 )518 ->if($classController = new mock\controller())519 ->and($classController->disableMethodChecking())520 ->and($classController->__construct = function () {521 })522 ->and($classController->getName = function () use (& $className) {523 return $className;524 })525 ->and($classController->getFileName = function () use (& $classFile) {526 return $classFile;527 })528 ->and($classController->getTraits = [])529 ->and($classController->getStartLine = 1)530 ->and($classController->getEndLine = 12)531 ->and($class = new \mock\reflectionClass(uniqid(), $classController))532 ->and($methodController = new mock\controller())533 ->and($methodController->__construct = function () {534 })535 ->and($methodController->getName = function () use (& $methodName) {536 return $methodName;537 })538 ->and($methodController->isAbstract = false)539 ->and($methodController->getFileName = function () use (& $classFile) {540 return $classFile;541 })542 ->and($methodController->getDeclaringClass = function () use ($class) {543 return $class;544 })545 ->and($methodController->getStartLine = 6)546 ->and($methodController->getEndLine = 8)547 ->and($method = new \mock\reflectionMethod(uniqid(), uniqid(), $methodController))548 ->and($classController->getMethod = function () use ($method) {549 return $method;550 })551 ->and($classController->getMethods = [$method])552 ->and($classFile = uniqid())553 ->and($className = uniqid())554 ->and($methodName = uniqid())555 ->and($xdebugData = [556 $classFile =>557 [558 5 => -2,559 6 => -1,560 7 => 1,561 8 => -2,562 9 =>-2563 ],564 uniqid() =>565 [566 5 => 2,567 6 => 3,568 7 => 4,569 8 => 3,570 9 => 2571 ]572 ]573 )574 ->and($coverage = new testedClass())575 ->and($coverage->setReflectionClassFactory(function () use ($class) {576 return $class;577 }))578 ->and($coverage->excludeClass($className))579 ->and($otherCoverage = new testedClass())580 ->and($otherCoverage->setReflectionClassFactory(function () use ($class) {581 return $class;582 }))583 ->and($otherCoverage->addXdebugDataForTest($this, $xdebugData))584 ->then585 ->array($otherCoverage->getClasses())->isNotEmpty()586 ->array($otherCoverage->getMethods())->isNotEmpty()587 ->object($coverage->merge($otherCoverage))->isIdenticalTo($coverage)588 ->array($coverage->getClasses())->isEmpty()589 ->array($coverage->getMethods())->isEmpty()590 ;591 }592 public function testCount()593 {594 $this595 ->if($coverage = new testedClass())596 ->then597 ->sizeOf($coverage)->isZero()598 ->if($classController = new mock\controller())599 ->and($classController->disableMethodChecking())600 ->and($classController->__construct = function () {601 })602 ->and($classController->getName = function () use (& $className) {603 return $className;604 })605 ->and($classController->getFileName = function () use (& $classFile) {606 return $classFile;607 })608 ->and($classController->getTraits = [])609 ->and($classController->getStartLine = 1)610 ->and($classController->getEndLine = 12)611 ->and($class = new \mock\reflectionClass(uniqid(), $classController))612 ->and($methodController = new mock\controller())613 ->and($methodController->__construct = function () {614 })615 ->and($methodController->getName = function () use (& $methodName) {616 return $methodName;617 })618 ->and($methodController->isAbstract = false)619 ->and($methodController->getFileName = function () use (& $classFile) {620 return $classFile;621 })622 ->and($methodController->getDeclaringClass = function () use ($class) {623 return $class;624 })625 ->and($methodController->getStartLine = 6)626 ->and($methodController->getEndLine = 8)627 ->and($classController->getMethods = [new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)])628 ->and($classFile = uniqid())629 ->and($className = uniqid())630 ->and($methodName = uniqid())631 ->and($xdebugData = [632 $classFile =>633 [634 5 => 1,635 6 => 2,636 7 => 3,637 8 => 2,638 9 => 1639 ],640 uniqid() =>641 [642 5 => 2,643 6 => 3,644 7 => 4,645 8 => 3,646 9 => 2647 ]648 ]649 )650 ->and($coverage->setReflectionClassFactory(function () use ($class) {651 return $class;652 }))653 ->then654 ->sizeOf($coverage->addXdebugDataForTest($this, $xdebugData))->isEqualTo(1)655 ;656 }657 public function testGetClasses()658 {659 $this660 ->if($classController = new mock\controller())661 ->and($classController->disableMethodChecking())662 ->and($classController->__construct = function () {663 })664 ->and($classController->getName = function () use (& $className) {665 return $className;666 })667 ->and($classController->getFileName = function () use (& $classFile) {668 return $classFile;669 })670 ->and($classController->getTraits = [])671 ->and($classController->getStartLine = 1)672 ->and($classController->getEndLine = 12)673 ->and($class = new \mock\reflectionClass(uniqid(), $classController))674 ->and($methodController = new mock\controller())675 ->and($methodController->__construct = function () {676 })677 ->and($methodController->getName = function () {678 return uniqid();679 })680 ->and($methodController->isAbstract = false)681 ->and($methodController->getFileName = function () use (& $classFile) {682 return $classFile;683 })684 ->and($methodController->getDeclaringClass = function () use ($class) {685 return $class;686 })687 ->and($methodController->getStartLine = 4)688 ->and($methodController->getEndLine = 8)689 ->and($classController->getMethods = [new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)])690 ->and($classFile = uniqid())691 ->and($className = uniqid())692 ->and($xdebugData = [693 $classFile =>694 [695 3 => -2,696 4 => -1,697 5 => -1,698 6 => -1,699 7 => -1,700 8 => -2,701 9 => -2702 ]703 ]704 )705 ->and($coverage = new testedClass())706 ->and($coverage->setReflectionClassFactory(function () use ($class) {707 return $class;708 }))709 ->and($coverage->addXdebugDataForTest($this, $xdebugData))710 ->then711 ->array($coverage->getClasses())->isEqualTo([$className => $classFile])712 ;713 }714 public function testGetValue()715 {716 $this717 ->if($classController = new mock\controller())718 ->and($classController->disableMethodChecking())719 ->and($classController->__construct = function () {720 })721 ->and($classController->getName = function () use (& $className) {722 return $className;723 })724 ->and($classController->getFileName = function () use (& $classFile) {725 return $classFile;726 })727 ->and($classController->getTraits = [])728 ->and($classController->getStartLine = 1)729 ->and($classController->getEndLine = 12)730 ->and($class = new \mock\reflectionClass(uniqid(), $classController))731 ->and($methodController = new mock\controller())732 ->and($methodController->__construct = function () {733 })734 ->and($methodController->getName = function () {735 return uniqid();736 })737 ->and($methodController->isAbstract = false)738 ->and($methodController->getFileName = function () use (& $classFile) {739 return $classFile;740 })741 ->and($methodController->getDeclaringClass = function () use ($class) {742 return $class;743 })744 ->and($methodController->getStartLine = 4)745 ->and($methodController->getEndLine = 8)746 ->and($classController->getMethods = [new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)])747 ->and($classFile = uniqid())748 ->and($className = uniqid())749 ->and($xdebugData = [750 $classFile =>751 [752 3 => -2,753 4 => -1,754 5 => -1,755 6 => -1,756 7 => -1,757 8 => -2,758 9 => -2759 ],760 uniqid() =>761 [762 5 => 2,763 6 => 3,764 7 => 4,765 8 => 3,766 9 => 2767 ]768 ]769 )770 ->and($coverage = new testedClass())771 ->and($coverage->setReflectionClassFactory(function () use ($class) {772 return $class;773 }))774 ->and($coverage->addXdebugDataForTest($this, $xdebugData))775 ->then776 ->float($coverage->getValue())->isEqualTo(0.0)777 ->if($xdebugData = [778 $classFile =>779 [780 3 => -2,781 4 => 1,782 5 => -1,783 6 => -1,784 7 => -1,785 8 => -2,786 9 => -1787 ],788 uniqid() =>789 [790 5 => 2,791 6 => 3,792 7 => 4,793 8 => 3,794 9 => 2795 ]796 ]797 )798 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))799 ->then800 ->float($coverage->getValue())->isEqualTo(1 / 4)801 ->if($xdebugData = [802 $classFile =>803 [804 3 => -2,805 4 => 1,806 5 => -1,807 6 => -1,808 7 => 1,809 8 => -2,810 9 => -1811 ],812 uniqid() =>813 [814 5 => 2,815 6 => 3,816 7 => 4,817 8 => 3,818 9 => 2819 ]820 ]821 )822 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))823 ->then824 ->float($coverage->getValue())->isEqualTo(2 / 4)825 ->if($xdebugData = [826 $classFile =>827 [828 3 => -2,829 4 => 1,830 5 => 1,831 6 => 1,832 7 => 1,833 8 => -2,834 9 => -1835 ],836 uniqid() =>837 [838 5 => 2,839 6 => 3,840 7 => 4,841 8 => 3,842 9 => 2843 ]844 ]845 )846 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))847 ->then848 ->float($coverage->getValue())->isEqualTo(1.0)849 ;850 }851 public function testGetValueForClass()852 {853 $this854 ->if($coverage = new testedClass())855 ->then856 ->variable($coverage->getValueForClass(uniqid()))->isNull()857 ->if($classController = new mock\controller())858 ->and($classController->disableMethodChecking())859 ->and($classController->__construct = function () {860 })861 ->and($classController->getName = function () use (& $className) {862 return $className;863 })864 ->and($classController->getFileName = function () use (& $classFile) {865 return $classFile;866 })867 ->and($classController->getTraits = [])868 ->and($classController->getStartLine = 1)869 ->and($classController->getEndLine = 12)870 ->and($class = new \mock\reflectionClass(uniqid(), $classController))871 ->and($methodController = new mock\controller())872 ->and($methodController->__construct = function () {873 })874 ->and($methodController->getName = function () {875 return uniqid();876 })877 ->and($methodController->isAbstract = false)878 ->and($methodController->getFileName = function () use (& $classFile) {879 return $classFile;880 })881 ->and($methodController->getDeclaringClass = function () use ($class) {882 return $class;883 })884 ->and($methodController->getStartLine = 4)885 ->and($methodController->getEndLine = 8)886 ->and($classController->getMethods = [new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)])887 ->and($classFile = uniqid())888 ->and($className = uniqid())889 ->and($xdebugData = [890 $classFile =>891 [892 3 => -2,893 4 => -1,894 5 => -1,895 6 => -1,896 7 => -1,897 8 => -2,898 9 => -2899 ],900 uniqid() =>901 [902 5 => 2,903 6 => 3,904 7 => 4,905 8 => 3,906 9 => 2907 ]908 ]909 )910 ->and($coverage = new testedClass())911 ->and($coverage->setReflectionClassFactory(function () use ($class) {912 return $class;913 }))914 ->and($coverage->addXdebugDataForTest($this, $xdebugData))915 ->then916 ->variable($coverage->getValueForClass(uniqid()))->isNull()917 ->float($coverage->getValueForClass($className))->isEqualTo(0.0)918 ->if($xdebugData = [919 $classFile =>920 [921 3 => -2,922 4 => 1,923 5 => -1,924 6 => -1,925 7 => -1,926 8 => -2,927 9 => -1928 ],929 uniqid() =>930 [931 5 => 2,932 6 => 3,933 7 => 4,934 8 => 3,935 9 => 2936 ]937 ]938 )939 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))940 ->then941 ->variable($coverage->getValueForClass(uniqid()))->isNull()942 ->float($coverage->getValueForClass($className))->isEqualTo(1 / 4)943 ->if($xdebugData = [944 $classFile =>945 [946 3 => -2,947 4 => 1,948 5 => -1,949 6 => -1,950 7 => 1,951 8 => -2,952 9 => -1953 ],954 uniqid() =>955 [956 5 => 2,957 6 => 3,958 7 => 4,959 8 => 3,960 9 => 2961 ]962 ]963 )964 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))965 ->then966 ->variable($coverage->getValueForClass(uniqid()))->isNull()967 ->float($coverage->getValueForClass($className))->isEqualTo(2 / 4)968 ->if($xdebugData = [969 $classFile =>970 [971 3 => -2,972 4 => 1,973 5 => 1,974 6 => 1,975 7 => 1,976 8 => -2,977 9 => -1978 ],979 uniqid() =>980 [981 5 => 2,982 6 => 3,983 7 => 4,984 8 => 3,985 9 => 2986 ]987 ]988 )989 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))990 ->then991 ->variable($coverage->getValueForClass(uniqid()))->isNull()992 ->float($coverage->getValueForClass($className))->isEqualTo(1.0)993 ;994 }995 public function testGetCoverageForClass()996 {997 $this998 ->if($coverage = new testedClass())999 ->then1000 ->array($coverage->getCoverageForClass(uniqid()))->isEmpty()1001 ->if($classController = new mock\controller())1002 ->and($classController->disableMethodChecking())1003 ->and($classController->__construct = function () {1004 })1005 ->and($classController->getName = function () use (& $className) {1006 return $className;1007 })1008 ->and($classController->getFileName = function () use (& $classFile) {1009 return $classFile;1010 })1011 ->and($classController->getTraits = [])1012 ->and($classController->getStartLine = 1)1013 ->and($classController->getEndLine = 12)1014 ->and($class = new \mock\reflectionClass(uniqid(), $classController))1015 ->and($methodController = new mock\controller())1016 ->and($methodController->__construct = function () {1017 })1018 ->and($methodController->getName = function () use (& $methodName) {1019 return $methodName;1020 })1021 ->and($methodController->isAbstract = false)1022 ->and($methodController->getFileName = function () use (& $classFile) {1023 return $classFile;1024 })1025 ->and($methodController->getDeclaringClass = function () use ($class) {1026 return $class;1027 })1028 ->and($methodController->getStartLine = 4)1029 ->and($methodController->getEndLine = 8)1030 ->and($classController->getMethods = [new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)])1031 ->and($classFile = uniqid())1032 ->and($className = uniqid())1033 ->and($methodName = uniqid())1034 ->and($xdebugData = [1035 $classFile =>1036 [1037 3 => -2,1038 4 => 1,1039 5 => -1,1040 6 => -1,1041 7 => -1,1042 8 => -2,1043 9 => -11044 ],1045 uniqid() =>1046 [1047 5 => 2,1048 6 => 3,1049 7 => 4,1050 8 => 3,1051 9 => 21052 ]1053 ]1054 )1055 ->and($expected = [1056 $methodName =>1057 [1058 4 => 1,1059 5 => -1,1060 6 => -1,1061 7 => -1,1062 8 => -2,1063 ]1064 ]1065 )1066 ->and($coverage->setReflectionClassFactory(function () use ($class) {1067 return $class;1068 }))1069 ->and($coverage->addXdebugDataForTest($this, $xdebugData))1070 ->then1071 ->array($coverage->getCoverageForClass($className))->isEqualTo($expected)1072 ;1073 }1074 public function testGetNumberOfCoverableLinesInClass()1075 {1076 $this1077 ->if($coverage = new testedClass())1078 ->then1079 ->integer($coverage->getNumberOfCoverableLinesInClass(uniqid()))->isZero()1080 ->if($classController = new mock\controller())1081 ->and($classController->disableMethodChecking())1082 ->and($classController->__construct = function () {1083 })1084 ->and($classController->getName = function () use (& $className) {1085 return $className;1086 })1087 ->and($classController->getFileName = function () use (& $classFile) {1088 return $classFile;1089 })1090 ->and($classController->getTraits = [])1091 ->and($classController->getStartLine = 1)1092 ->and($classController->getEndLine = 12)1093 ->and($class = new \mock\reflectionClass(uniqid(), $classController))1094 ->and($methodController = new mock\controller())1095 ->and($methodController->__construct = function () {1096 })1097 ->and($methodController->getName = function () use (& $methodName) {1098 return $methodName;1099 })1100 ->and($methodController->isAbstract = false)1101 ->and($methodController->getFileName = function () use (& $classFile) {1102 return $classFile;1103 })1104 ->and($methodController->getDeclaringClass = function () use ($class) {1105 return $class;1106 })1107 ->and($methodController->getStartLine = 4)1108 ->and($methodController->getEndLine = 8)1109 ->and($classController->getMethods = [new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)])1110 ->and($classFile = uniqid())1111 ->and($className = uniqid())1112 ->and($methodName = uniqid())1113 ->and($xdebugData = [1114 $classFile =>1115 [1116 3 => -2,1117 4 => 1,1118 5 => -1,1119 6 => -1,1120 7 => -1,1121 8 => -2,1122 9 => -11123 ],1124 uniqid() =>1125 [1126 5 => 2,1127 6 => 3,1128 7 => 4,1129 8 => 3,1130 9 => 21131 ]1132 ]1133 )1134 ->and($coverage->setReflectionClassFactory(function () use ($class) {1135 return $class;1136 }))1137 ->and($coverage->addXdebugDataForTest($this, $xdebugData))1138 ->then1139 ->integer($coverage->getNumberOfCoverableLinesInClass($className))->isEqualTo(4)1140 ;1141 }1142 public function testGetNumberOfCoveredLinesInClass()1143 {1144 $this1145 ->if($coverage = new testedClass())1146 ->then1147 ->integer($coverage->getNumberOfCoveredLinesInClass(uniqid()))->isZero()1148 ->if($classController = new mock\controller())1149 ->and($classController->disableMethodChecking())1150 ->and($classController->__construct = function () {1151 })1152 ->and($classController->getName = function () use (& $className) {1153 return $className;1154 })1155 ->and($classController->getFileName = function () use (& $classFile) {1156 return $classFile;1157 })1158 ->and($classController->getTraits = [])1159 ->and($classController->getStartLine = 1)1160 ->and($classController->getEndLine = 12)1161 ->and($class = new \mock\reflectionClass(uniqid(), $classController))1162 ->and($methodController = new mock\controller())1163 ->and($methodController->__construct = function () {1164 })1165 ->and($methodController->getName = function () use (& $methodName) {1166 return $methodName;1167 })1168 ->and($methodController->isAbstract = false)1169 ->and($methodController->getFileName = function () use (& $classFile) {1170 return $classFile;1171 })1172 ->and($methodController->getDeclaringClass = function () use ($class) {1173 return $class;1174 })1175 ->and($methodController->getStartLine = 4)1176 ->and($methodController->getEndLine = 8)1177 ->and($classController->getMethods = [new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)])1178 ->and($classFile = uniqid())1179 ->and($className = uniqid())1180 ->and($methodName = uniqid())1181 ->and($xdebugData = [1182 $classFile =>1183 [1184 3 => -2,1185 4 => 1,1186 5 => -1,1187 6 => -1,1188 7 => -1,1189 8 => -2,1190 9 => -11191 ],1192 uniqid() =>1193 [1194 5 => 2,1195 6 => 3,1196 7 => 4,1197 8 => 3,1198 9 => 21199 ]1200 ]1201 )1202 ->and($coverage->setReflectionClassFactory(function () use ($class) {1203 return $class;1204 }))1205 ->and($coverage->addXdebugDataForTest($this, $xdebugData))1206 ->then1207 ->integer($coverage->getNumberOfCoveredLinesInClass($className))->isEqualTo(1)1208 ;1209 }1210 public function testGetValueForMethod()1211 {1212 $this1213 ->if($coverage = new testedClass())1214 ->then1215 ->variable($coverage->getValueForMethod(uniqid(), uniqid()))->isNull()1216 ->if($classController = new mock\controller())1217 ->and($classController->disableMethodChecking())1218 ->and($classController->__construct = function () {1219 })1220 ->and($classController->getName = function () use (& $className) {1221 return $className;1222 })1223 ->and($classController->getFileName = function () use (& $classFile) {1224 return $classFile;1225 })1226 ->and($classController->getTraits = [])1227 ->and($classController->getStartLine = 1)1228 ->and($classController->getEndLine = 12)1229 ->and($class = new \mock\reflectionClass(uniqid(), $classController))1230 ->and($methodController = new mock\controller())1231 ->and($methodController->__construct = function () {1232 })1233 ->and($methodController->getName = function () use (& $methodName) {1234 return $methodName;1235 })1236 ->and($methodController->isAbstract = false)1237 ->and($methodController->getFileName = function () use (& $classFile) {1238 return $classFile;1239 })1240 ->and($methodController->getDeclaringClass = function () use ($class) {1241 return $class;1242 })1243 ->and($methodController->getStartLine = 4)1244 ->and($methodController->getEndLine = 8)1245 ->and($classController->getMethods = [new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)])1246 ->and($classFile = uniqid())1247 ->and($className = uniqid())1248 ->and($methodName = uniqid())1249 ->and($xdebugData = [1250 $classFile =>1251 [1252 3 => -2,1253 4 => -1,1254 5 => -1,1255 6 => -1,1256 7 => -1,1257 8 => -2,1258 9 => -21259 ],1260 uniqid() =>1261 [1262 5 => 2,1263 6 => 3,1264 7 => 4,1265 8 => 3,1266 9 => 21267 ]1268 ]1269 )1270 ->and($coverage->setReflectionClassFactory(function () use ($class) {1271 return $class;1272 }))1273 ->and($coverage->addXdebugDataForTest($this, $xdebugData))1274 ->then1275 ->variable($coverage->getValueForMethod(uniqid(), uniqid()))->isNull()1276 ->variable($coverage->getValueForMethod($className, uniqid()))->isNull()1277 ->float($coverage->getValueForMethod($className, $methodName))->isEqualTo(0.0)1278 ->if($xdebugData = [1279 $classFile =>1280 [1281 3 => -2,1282 4 => 1,1283 5 => -1,1284 6 => -1,1285 7 => -1,1286 8 => -2,1287 9 => -11288 ],1289 uniqid() =>1290 [1291 5 => 2,1292 6 => 3,1293 7 => 4,1294 8 => 3,1295 9 => 21296 ]1297 ]1298 )1299 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))1300 ->then1301 ->variable($coverage->getValueForMethod(uniqid(), uniqid()))->isNull()1302 ->variable($coverage->getValueForMethod($className, uniqid()))->isNull()1303 ->float($coverage->getValueForMethod($className, $methodName))->isEqualTo(1 / 4)1304 ->if($xdebugData = [1305 $classFile =>1306 [1307 3 => -2,1308 4 => 1,1309 5 => -1,1310 6 => -1,1311 7 => 1,1312 8 => -2,1313 9 => -11314 ],1315 uniqid() =>1316 [1317 5 => 2,1318 6 => 3,1319 7 => 4,1320 8 => 3,1321 9 => 21322 ]1323 ]1324 )1325 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))1326 ->then1327 ->variable($coverage->getValueForMethod(uniqid(), uniqid()))->isNull()1328 ->variable($coverage->getValueForMethod($className, uniqid()))->isNull()1329 ->float($coverage->getValueForMethod($className, $methodName))->isEqualTo(2 / 4)1330 ->if($xdebugData = [1331 $classFile =>1332 [1333 3 => -2,1334 4 => 1,1335 5 => 1,1336 6 => 1,1337 7 => 1,1338 8 => -2,1339 9 => -11340 ],1341 uniqid() =>1342 [1343 5 => 2,1344 6 => 3,1345 7 => 4,1346 8 => 3,1347 9 => 21348 ]1349 ]1350 )1351 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))1352 ->then1353 ->variable($coverage->getValueForMethod(uniqid(), uniqid()))->isNull()1354 ->variable($coverage->getValueForMethod($className, uniqid()))->isNull()1355 ->float($coverage->getValueForMethod($className, $methodName))->isEqualTo(1.0)1356 ;1357 }1358 public function testGetCoverageForMethod()1359 {1360 $this1361 ->if($coverage = new testedClass())1362 ->then1363 ->array($coverage->getCoverageForClass(uniqid()))->isEmpty()1364 ->if($classController = new mock\controller())1365 ->and($classController->disableMethodChecking())1366 ->and($classController->__construct = function () {1367 })1368 ->and($classController->getName = function () use (& $className) {1369 return $className;1370 })1371 ->and($classController->getFileName = function () use (& $classFile) {1372 return $classFile;1373 })1374 ->and($classController->getTraits = [])1375 ->and($classController->getStartLine = 1)1376 ->and($classController->getEndLine = 12)1377 ->and($class = new \mock\reflectionClass(uniqid(), $classController))1378 ->and($methodController = new mock\controller())1379 ->and($methodController->__construct = function () {1380 })1381 ->and($methodController->getName = function () use (& $methodName) {1382 return $methodName;1383 })1384 ->and($methodController->isAbstract = false)1385 ->and($methodController->getFileName = function () use (& $classFile) {1386 return $classFile;1387 })1388 ->and($methodController->getDeclaringClass = function () use ($class) {1389 return $class;1390 })1391 ->and($methodController->getStartLine = 4)1392 ->and($methodController->getEndLine = 8)1393 ->and($classController->getMethods = [new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)])1394 ->and($classFile = uniqid())1395 ->and($className = uniqid())1396 ->and($methodName = uniqid())1397 ->and($xdebugData = [1398 $classFile =>1399 [1400 3 => -2,1401 4 => 1,1402 5 => -1,1403 6 => -1,1404 7 => -1,1405 8 => -2,1406 9 => -11407 ],1408 uniqid() =>1409 [1410 5 => 2,1411 6 => 3,1412 7 => 4,1413 8 => 3,1414 9 => 21415 ]1416 ]1417 )1418 ->and($expected = [1419 4 => 1,1420 5 => -1,1421 6 => -1,1422 7 => -1,1423 8 => -2,1424 ]1425 )1426 ->and($coverage = new testedClass())1427 ->and($coverage->setReflectionClassFactory(function () use ($class) {1428 return $class;1429 }))1430 ->and($coverage->addXdebugDataForTest($this, $xdebugData))1431 ->then1432 ->array($coverage->getCoverageForMethod($className, $methodName))->isEqualTo($expected)1433 ;1434 }1435 public function testExcludeMethod()1436 {1437 $this1438 ->if($coverage = new testedClass())1439 ->then1440 ->object($coverage->excludeMethod($method = uniqid()))->isIdenticalTo($coverage)1441 ->array($coverage->getExcludedMethods())->isEqualTo([$method])1442 ->object($coverage->excludeMethod($otherClass = rand(1, PHP_INT_MAX)))->isIdenticalTo($coverage)1443 ->array($coverage->getExcludedMethods())->isEqualTo([$method, (string) $otherClass])1444 ->object($coverage->excludeMethod($method))->isIdenticalTo($coverage)1445 ->array($coverage->getExcludedMethods())->isEqualTo([$method, (string) $otherClass])1446 ;1447 }1448 public function testExcludeClass()1449 {1450 $this1451 ->if($coverage = new testedClass())1452 ->then1453 ->object($coverage->excludeClass($class = uniqid()))->isIdenticalTo($coverage)1454 ->array($coverage->getExcludedClasses())->isEqualTo([$class])1455 ->object($coverage->excludeClass($otherClass = rand(1, PHP_INT_MAX)))->isIdenticalTo($coverage)1456 ->array($coverage->getExcludedClasses())->isEqualTo([$class, (string) $otherClass])1457 ->object($coverage->excludeClass($class))->isIdenticalTo($coverage)1458 ->array($coverage->getExcludedClasses())->isEqualTo([$class, (string) $otherClass])1459 ;1460 }1461 public function testExcludeNamespace()1462 {1463 $this1464 ->if($coverage = new testedClass())1465 ->then1466 ->object($coverage->excludeNamespace($namespace = uniqid()))->isIdenticalTo($coverage)1467 ->array($coverage->getExcludedNamespaces())->isEqualTo([$namespace])1468 ->object($coverage->excludeNamespace($otherNamespace = rand(1, PHP_INT_MAX)))->isIdenticalTo($coverage)1469 ->array($coverage->getExcludedNamespaces())->isEqualTo([$namespace, (string) $otherNamespace])1470 ->object($coverage->excludeNamespace($namespace))->isIdenticalTo($coverage)1471 ->array($coverage->getExcludedNamespaces())->isEqualTo([$namespace, (string) $otherNamespace])1472 ->object($coverage->excludeNamespace('\\' . ($anotherNamespace = uniqid()) . '\\'))->isIdenticalTo($coverage)...

Full Screen

Full Screen

getExcludedClasses

Using AI Code Generation

copy

Full Screen

1$coverage->getExcludedClasses();2$coverage->getExcludedDirectories();3$coverage->getExcludedFiles();4$coverage->getFilter();5$coverage->getReport();6$coverage->setAddUncoveredFilesFromWhitelist(true);7$coverage->setCacheTokens(true);8$coverage->setCheckForUnintentionallyCoveredCode(true);9$coverage->setForceCoversAnnotation(true);10$coverage->setProcessUncoveredFilesFromWhitelist(true);11$coverage->setUnintentionallyCoveredSubclassesWhitelist(['class1', 'class2']);12$coverage->setUnintentionallyCoveredSubclassesWhitelistFromAnnotation(true);13$coverage->addDirectoryToWhitelist('path/to/directory');14$coverage->addFileToWhitelist('path/to/file');15$coverage->append($coverage, $merge);16$coverage->clear();17$coverage->clearWhitelist();18$coverage->merge($coverage, $merge);19$coverage->processUncoveredFilesFromWhitelist();20$coverage->report();

Full Screen

Full Screen

getExcludedClasses

Using AI Code Generation

copy

Full Screen

1$coverage = new PHP_CodeCoverage();2$coverage->start('1.php');3include '1.php';4$coverage->stop();5$excludedClasses = $coverage->getExcludedClasses();6$coverage = new PHP_CodeCoverage();7$coverage->start('2.php');8include '2.php';9$coverage->stop();10$excludedClasses = $coverage->getExcludedClasses();11$coverage = new PHP_CodeCoverage();12$coverage->start('3.php');13include '3.php';14$coverage->stop();15$excludedClasses = $coverage->getExcludedClasses();16$coverage = new PHP_CodeCoverage();17$coverage->start('4.php');18include '4.php';19$coverage->stop();20$excludedClasses = $coverage->getExcludedClasses();21$coverage = new PHP_CodeCoverage();22$coverage->start('5.php');23include '5.php';24$coverage->stop();25$excludedClasses = $coverage->getExcludedClasses();26$coverage = new PHP_CodeCoverage();27$coverage->start('6.php');28include '6.php';29$coverage->stop();30$excludedClasses = $coverage->getExcludedClasses();31$coverage = new PHP_CodeCoverage();32$coverage->start('7.php');33include '7.php';34$coverage->stop();35$excludedClasses = $coverage->getExcludedClasses();36$coverage = new PHP_CodeCoverage();37$coverage->start('8.php');38include '8.php';39$coverage->stop();40$excludedClasses = $coverage->getExcludedClasses();41$coverage = new PHP_CodeCoverage();42$coverage->start('9.php');43include '9.php';44$coverage->stop();

Full Screen

Full Screen

getExcludedClasses

Using AI Code Generation

copy

Full Screen

1$coverage = new PHP_CodeCoverage();2$coverage->getExcludedClasses();3$coverage = new PHP_CodeCoverage();4$driver = $coverage->getDriver();5$driver->getExcludedClasses();6$coverage = new PHP_CodeCoverage();7$filter = $coverage->filter();8$filter->getExcludedClasses();9$coverage = new PHP_CodeCoverage();10$filter = $coverage->filter();11$filter->getExcludedClasses();12$coverage = new PHP_CodeCoverage();13$filter = $coverage->filter();14$filter->getExcludedClasses();15$coverage = new PHP_CodeCoverage();16$filter = $coverage->filter();17$filter->getExcludedClasses();18$coverage = new PHP_CodeCoverage();19$filter = $coverage->filter();20$filter->getExcludedClasses();21$coverage = new PHP_CodeCoverage();22$filter = $coverage->filter();23$filter->getExcludedClasses();24$coverage = new PHP_CodeCoverage();25$filter = $coverage->filter();26$filter->getExcludedClasses();27$coverage = new PHP_CodeCoverage();28$filter = $coverage->filter();29$filter->getExcludedClasses();30$coverage = new PHP_CodeCoverage();31$filter = $coverage->filter();32$filter->getExcludedClasses();33$coverage = new PHP_CodeCoverage();34$filter = $coverage->filter();35$filter->getExcludedClasses();36$coverage = new PHP_CodeCoverage();37$filter = $coverage->filter();38$filter->getExcludedClasses();39$coverage = new PHP_CodeCoverage();40$filter = $coverage->filter();41$filter->getExcludedClasses();

Full Screen

Full Screen

getExcludedClasses

Using AI Code Generation

copy

Full Screen

1$coverage = new PHP_CodeCoverage();2$coverage->start('1.php');3$coverage->stop();4$excluded = $coverage->getExcludedClasses();5print_r($excluded);6$coverage = new PHP_CodeCoverage();7$coverage->start('2.php');8$coverage->stop();9$excluded = $coverage->getExcludedClasses();10print_r($excluded);

Full Screen

Full Screen

getExcludedClasses

Using AI Code Generation

copy

Full Screen

1$coverage = new PHP_CodeCoverage();2$coverage->getExcludedClasses();3$coverage = new PHP_CodeCoverage();4$coverage->getExcludedClasses();5$coverage = new PHP_CodeCoverage();6$coverage->getExcludedClasses();7$coverage = new PHP_CodeCoverage();8$coverage->getExcludedClasses();9$coverage = new PHP_CodeCoverage();10$coverage->getExcludedClasses();11$coverage = new PHP_CodeCoverage();12$coverage->getExcludedClasses();13$coverage = new PHP_CodeCoverage();14$coverage->getExcludedClasses();15$coverage = new PHP_CodeCoverage();16$coverage->getExcludedClasses();17$coverage = new PHP_CodeCoverage();18$coverage->getExcludedClasses();19$coverage = new PHP_CodeCoverage();20$coverage->getExcludedClasses();21$coverage = new PHP_CodeCoverage();22$coverage->getExcludedClasses();23$coverage = new PHP_CodeCoverage();24$coverage->getExcludedClasses();25$coverage = new PHP_CodeCoverage();26$coverage->getExcludedClasses();

Full Screen

Full Screen

getExcludedClasses

Using AI Code Generation

copy

Full Screen

1$coverage = new PHP_CodeCoverage();2$coverage->start('1.php');3require_once('1.php');4$coverage->stop();5$classes = $coverage->getExcludedClasses();6";7foreach($classes as $class)8{9";10}11$coverage = new PHP_CodeCoverage();12$coverage->start('2.php');13require_once('2.php');14$coverage->stop();15$classes = $coverage->getExcludedClasses();16";17foreach($classes as $class)18{19";20}21$coverage = new PHP_CodeCoverage();22$coverage->start('3.php');23require_once('3.php');24$coverage->stop();25$classes = $coverage->getExcludedClasses();26";27foreach($classes as $class)28{29";30}

Full Screen

Full Screen

getExcludedClasses

Using AI Code Generation

copy

Full Screen

1include "phpcoverage/coverage.php";2$coverage = new coverage;3$coverage->start();4echo "hello world";5$coverage->stop();6$excluded_classes = $coverage->getExcludedClasses();7var_dump($excluded_classes);8include "phpcoverage/coverage.php";9$coverage = new coverage;10$coverage->start();11echo "hello world";12$coverage->stop();13$excluded_classes = $coverage->getExcludedClasses();14var_dump($excluded_classes);15include "phpcoverage/coverage.php";16$coverage = new coverage;17$coverage->start();18echo "hello world";19$coverage->stop();20$excluded_classes = $coverage->getExcludedClasses();21var_dump($excluded_classes);22include "phpcoverage/coverage.php";23$coverage = new coverage;24$coverage->start();25echo "hello world";26$coverage->stop();27$excluded_classes = $coverage->getExcludedClasses();28var_dump($excluded_classes);29include "phpcoverage/coverage.php";30$coverage = new coverage;31$coverage->start();32echo "hello world";33$coverage->stop();34$excluded_classes = $coverage->getExcludedClasses();35var_dump($excluded_classes);36include "phpcoverage/coverage.php";37$coverage = new coverage;38$coverage->start();39echo "hello world";40$coverage->stop();41$excluded_classes = $coverage->getExcludedClasses();42var_dump($excluded_classes);43include "phpcoverage/coverage.php";44$coverage = new coverage;45$coverage->start();46echo "hello world";47$coverage->stop();48$excluded_classes = $coverage->getExcludedClasses();49var_dump($excluded_classes);50include "phpcoverage/coverage.php";51$coverage = new coverage;

Full Screen

Full Screen

Automation Testing Tutorials

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

LambdaTest Learning Hubs:

YouTube

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

Run Atoum automation tests on LambdaTest cloud grid

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

Most used method in coverage

Trigger getExcludedClasses code on LambdaTest Cloud Grid

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

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful