How to use getExcludedDirectories method of coverage class

Best Atoum code snippet using coverage.getExcludedDirectories

coverage.php

Source:coverage.php Github

copy

Full Screen

...184 ->array($coverage->getClasses())->isEmpty()185 ->array($coverage->getMethods())->isEmpty()186 ->array($coverage->getExcludedClasses())->isEmpty()187 ->array($coverage->getExcludedNamespaces())->isEmpty()188 ->array($coverage->getExcludedDirectories())->isEmpty()189 ->object($coverage->reset())->isIdenticalTo($coverage)190 ->array($coverage->getClasses())->isEmpty()191 ->array($coverage->getMethods())->isEmpty()192 ->array($coverage->getExcludedClasses())->isEmpty()193 ->array($coverage->getExcludedNamespaces())->isEmpty()194 ->array($coverage->getExcludedDirectories())->isEmpty()195 ->if($classController = new mock\controller())196 ->and($classController->disableMethodChecking())197 ->and($classController->__construct = function() {})198 ->and($classController->getName = function() use (& $className) { return $className; })199 ->and($classController->getFileName = function() use (& $classFile) { return $classFile; })200 ->and($classController->getTraits = array())201 ->and($classController->getStartLine = 1)202 ->and($classController->getEndLine = 12)203 ->and($class = new \mock\reflectionClass(uniqid(), $classController))204 ->and($methodController = new mock\controller())205 ->and($methodController->__construct = function() {})206 ->and($methodController->getName = function() use (& $methodName) { return $methodName; })207 ->and($methodController->isAbstract = false)208 ->and($methodController->getFileName = function() use (& $classFile) { return $classFile; })209 ->and($methodController->getDeclaringClass = function() use ($class) { return $class; })210 ->and($methodController->getStartLine = 6)211 ->and($methodController->getEndLine = 8)212 ->and($classController->getMethods = array(new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)))213 ->and($classFile = uniqid())214 ->and($className = uniqid())215 ->and($methodName = uniqid())216 ->and($xdebugData = array(217 $classFile =>218 array(219 5 => 1,220 6 => 2,221 7 => 3,222 8 => 2,223 9 => 1224 ),225 uniqid() =>226 array(227 5 => 2,228 6 => 3,229 7 => 4,230 8 => 3,231 9 => 2232 )233 )234 )235 ->and($coverage = new testedClass())236 ->and($coverage->setReflectionClassFactory(function() use ($class) { return $class; }))237 ->and($coverage->addXdebugDataForTest($this, $xdebugData))238 ->and($coverage->excludeClass($excludedClass =uniqid()))239 ->and($coverage->excludeNamespace($excludedNamespace= uniqid()))240 ->and($coverage->excludeDirectory($excludedDirectory = uniqid()))241 ->then242 ->array($coverage->getClasses())->isNotEmpty()243 ->array($coverage->getMethods())->isNotEmpty()244 ->array($coverage->getExcludedClasses())->isNotEmpty()245 ->array($coverage->getExcludedNamespaces())->isNotEmpty()246 ->array($coverage->getExcludedDirectories())->isNotEmpty()247 ->object($coverage->reset())->isIdenticalTo($coverage)248 ->array($coverage->getClasses())->isEmpty()249 ->array($coverage->getMethods())->isEmpty()250 ->array($coverage->getExcludedClasses())->isNotEmpty()251 ->array($coverage->getExcludedNamespaces())->isNotEmpty()252 ->array($coverage->getExcludedDirectories())->isNotEmpty()253 ;254 }255 public function testResetExcludedClasses()256 {257 $this258 ->if($coverage = new testedClass())259 ->then260 ->object($coverage->resetExcludedClasses())->isIdenticalTo($coverage)261 ->array($coverage->getExcludedClasses())->isEmpty()262 ->if($coverage->excludeClass(uniqid()))263 ->then264 ->object($coverage->resetExcludedClasses())->isIdenticalTo($coverage)265 ->array($coverage->getExcludedClasses())->isEmpty()266 ;267 }268 public function testResetExcludedNamespaces()269 {270 $this271 ->if($coverage = new testedClass())272 ->then273 ->object($coverage->resetExcludedNamespaces())->isIdenticalTo($coverage)274 ->array($coverage->getExcludedNamespaces())->isEmpty()275 ->if($coverage->excludeNamespace(uniqid()))276 ->then277 ->object($coverage->resetExcludedNamespaces())->isIdenticalTo($coverage)278 ->array($coverage->getExcludedNamespaces())->isEmpty()279 ;280 }281 public function testResetExcludedDirectories()282 {283 $this284 ->if($coverage = new testedClass())285 ->then286 ->object($coverage->resetExcludedDirectories())->isIdenticalTo($coverage)287 ->array($coverage->getExcludedDirectories())->isEmpty()288 ->if($coverage->excludeDirectory(uniqid()))289 ->then290 ->object($coverage->resetExcludedDirectories())->isIdenticalTo($coverage)291 ->array($coverage->getExcludedDirectories())->isEmpty()292 ;293 }294 public function testMerge()295 {296 $this297 ->if($classController = new mock\controller())298 ->and($classController->disableMethodChecking())299 ->and($classController->__construct = function() {})300 ->and($classController->getName = function() use (& $className) { return $className; })301 ->and($classController->getFileName = function() use (& $classFile) { return $classFile; })302 ->and($classController->getTraits = array())303 ->and($classController->getStartLine = 1)304 ->and($classController->getEndLine = 12)305 ->and($class = new \mock\reflectionClass(uniqid(), $classController))306 ->and($methodController = new mock\controller())307 ->and($methodController->__construct = function() {})308 ->and($methodController->getName = function() use (& $methodName) { return $methodName; })309 ->and($methodController->isAbstract = false)310 ->and($methodController->getFileName = function() use (& $classFile) { return $classFile; })311 ->and($methodController->getDeclaringClass = function() use ($class) { return $class; })312 ->and($methodController->getStartLine = 6)313 ->and($methodController->getEndLine = 8)314 ->and($method = new \mock\reflectionMethod(uniqid(), uniqid(), $methodController))315 ->and($classController->getMethod = function() use ($method) { return $method; })316 ->and($classController->getMethods = array($method))317 ->and($classFile = uniqid())318 ->and($className = uniqid())319 ->and($methodName = uniqid())320 ->and($xdebugData = array(321 $classFile =>322 array(323 5 => -2,324 6 => -1,325 7 => 1,326 8 => -2,327 9 =>-2328 ),329 uniqid() =>330 array(331 5 => 2,332 6 => 3,333 7 => 4,334 8 => 3,335 9 => 2336 )337 )338 )339 ->and($coverage = new testedClass())340 ->and($coverage->setReflectionClassFactory(function() use ($class) { return $class; }))341 ->then342 ->object($coverage->merge($coverage))->isIdenticalTo($coverage)343 ->array($coverage->getClasses())->isEmpty()344 ->array($coverage->getMethods())->isEmpty()345 ->if($otherCoverage = new testedClass())346 ->then347 ->object($coverage->merge($otherCoverage))->isIdenticalTo($coverage)348 ->array($coverage->getClasses())->isEmpty()349 ->array($coverage->getMethods())->isEmpty()350 ->if($coverage->addXdebugDataForTest($this, $xdebugData))351 ->then352 ->object($coverage->merge($otherCoverage))->isIdenticalTo($coverage)353 ->array($coverage->getClasses())->isEqualTo(array($className => $classFile))354 ->array($coverage->getMethods())->isEqualTo(array(355 $className => array(356 $methodName => array(357 6 => -1,358 7 => 1,359 8 => -2360 )361 )362 )363 )364 ->object($coverage->merge($coverage))->isIdenticalTo($coverage)365 ->array($coverage->getClasses())->isEqualTo(array($className => $classFile))366 ->array($coverage->getMethods())->isEqualTo(array(367 $className => array(368 $methodName => array(369 6 => -1,370 7 => 1,371 8 => -2372 )373 )374 )375 )376 ->if($otherClassController = new mock\controller())377 ->and($otherClassController->disableMethodChecking())378 ->and($otherClassController->__construct = function() {})379 ->and($otherClassController->getName = function() use (& $otherClassName) { return $otherClassName; })380 ->and($otherClassController->getFileName = function() use (& $otherClassFile) { return $otherClassFile; })381 ->and($otherClassController->getTraits = array())382 ->and($otherClassController->getStartLine = 1)383 ->and($otherClassController->getEndLine = 12)384 ->and($otherClass = new \mock\reflectionClass($class, $otherClassController))385 ->and($otherMethodController = new mock\controller())386 ->and($otherMethodController->__construct = function() {})387 ->and($otherMethodController->getName = function() use (& $otherMethodName) { return $otherMethodName; })388 ->and($otherMethodController->isAbstract = false)389 ->and($otherMethodController->getFileName = function() use (& $otherClassFile) { return $otherClassFile; })390 ->and($otherMethodController->getDeclaringClass = function() use ($otherClass) { return $otherClass; })391 ->and($otherMethodController->getStartLine = 5)392 ->and($otherMethodController->getEndLine = 9)393 ->and($otherClassController->getMethods = array(new \mock\reflectionMethod(uniqid(), uniqid(), $otherMethodController)))394 ->and($otherClassFile = uniqid())395 ->and($otherClassName = uniqid())396 ->and($otherMethodName = uniqid())397 ->and($otherXdebugData = array(398 $otherClassFile =>399 array(400 1 => -2,401 2 => -1,402 3 => 1,403 4 => 1,404 5 => -1,405 6 => 1,406 7 => 1,407 8 => -1,408 9 => -2,409 10 => 1410 ),411 uniqid() =>412 array(413 500 => 200,414 600 => 300,415 700 => 400,416 800 => 300,417 900 => 200418 )419 )420 )421 ->and($otherCoverage->setReflectionClassFactory(function() use ($otherClass) { return $otherClass; }))422 ->then423 ->object($coverage->merge($otherCoverage->addXdebugDataForTest($this, $otherXdebugData)))->isIdenticalTo($coverage)424 ->array($coverage->getClasses())->isEqualTo(array(425 $className => $classFile,426 $otherClassName => $otherClassFile427 )428 )429 ->array($coverage->getMethods())->isEqualTo(array(430 $className => array(431 $methodName => array(432 6 => -1,433 7 => 1,434 8 =>-2435 )436 ),437 $otherClassName => array(438 $otherMethodName => array(439 5 => -1,440 6 => 1,441 7 => 1,442 8 => -1,443 9 => -2444 )445 )446 )447 )448 ->if($classController = new mock\controller())449 ->and($classController->disableMethodChecking())450 ->and($classController->__construct = function() {})451 ->and($classController->getName = function() use (& $className) { return $className; })452 ->and($classController->getFileName = function() use (& $classFile) { return $classFile; })453 ->and($classController->getTraits = array())454 ->and($classController->getStartLine = 1)455 ->and($classController->getEndLine = 12)456 ->and($class = new \mock\reflectionClass(uniqid(), $classController))457 ->and($methodController = new mock\controller())458 ->and($methodController->__construct = function() {})459 ->and($methodController->getName = function() use (& $methodName) { return $methodName; })460 ->and($methodController->isAbstract = false)461 ->and($methodController->getFileName = function() use (& $classFile) { return $classFile; })462 ->and($methodController->getDeclaringClass = function() use ($class) { return $class; })463 ->and($methodController->getStartLine = 6)464 ->and($methodController->getEndLine = 8)465 ->and($method = new \mock\reflectionMethod(uniqid(), uniqid(), $methodController))466 ->and($classController->getMethod = function() use ($method) { return $method; })467 ->and($classController->getMethods = array($method))468 ->and($classFile = uniqid())469 ->and($className = uniqid())470 ->and($methodName = uniqid())471 ->and($xdebugData = array(472 $classFile =>473 array(474 5 => -2,475 6 => -1,476 7 => 1,477 8 => -2,478 9 =>-2479 ),480 uniqid() =>481 array(482 5 => 2,483 6 => 3,484 7 => 4,485 8 => 3,486 9 => 2487 )488 )489 )490 ->and($coverage = new testedClass())491 ->and($coverage->setReflectionClassFactory(function() use ($class) { return $class; }))492 ->and($coverage->excludeClass($className))493 ->and($otherCoverage = new testedClass())494 ->and($otherCoverage->setReflectionClassFactory(function() use ($class) { return $class; }))495 ->and($otherCoverage->addXdebugDataForTest($this, $xdebugData))496 ->then497 ->array($otherCoverage->getClasses())->isNotEmpty()498 ->array($otherCoverage->getMethods())->isNotEmpty()499 ->object($coverage->merge($otherCoverage))->isIdenticalTo($coverage)500 ->array($coverage->getClasses())->isEmpty()501 ->array($coverage->getMethods())->isEmpty()502 ;503 }504 public function testCount()505 {506 $this507 ->if($coverage = new testedClass())508 ->then509 ->sizeOf($coverage)->isZero()510 ->if($classController = new mock\controller())511 ->and($classController->disableMethodChecking())512 ->and($classController->__construct = function() {})513 ->and($classController->getName = function() use (& $className) { return $className; })514 ->and($classController->getFileName = function() use (& $classFile) { return $classFile; })515 ->and($classController->getTraits = array())516 ->and($classController->getStartLine = 1)517 ->and($classController->getEndLine = 12)518 ->and($class = new \mock\reflectionClass(uniqid(), $classController))519 ->and($methodController = new mock\controller())520 ->and($methodController->__construct = function() {})521 ->and($methodController->getName = function() use (& $methodName) { return $methodName; })522 ->and($methodController->isAbstract = false)523 ->and($methodController->getFileName = function() use (& $classFile) { return $classFile; })524 ->and($methodController->getDeclaringClass = function() use ($class) { return $class; })525 ->and($methodController->getStartLine = 6)526 ->and($methodController->getEndLine = 8)527 ->and($classController->getMethods = array(new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)))528 ->and($classFile = uniqid())529 ->and($className = uniqid())530 ->and($methodName = uniqid())531 ->and($xdebugData = array(532 $classFile =>533 array(534 5 => 1,535 6 => 2,536 7 => 3,537 8 => 2,538 9 => 1539 ),540 uniqid() =>541 array(542 5 => 2,543 6 => 3,544 7 => 4,545 8 => 3,546 9 => 2547 )548 )549 )550 ->and($coverage->setReflectionClassFactory(function() use ($class) { return $class; }))551 ->then552 ->sizeOf($coverage->addXdebugDataForTest($this, $xdebugData))->isEqualTo(1)553 ;554 }555 public function testGetClasses()556 {557 $this558 ->if($classController = new mock\controller())559 ->and($classController->disableMethodChecking())560 ->and($classController->__construct = function() {})561 ->and($classController->getName = function() use (& $className) { return $className; })562 ->and($classController->getFileName = function() use (& $classFile) { return $classFile; })563 ->and($classController->getTraits = array())564 ->and($classController->getStartLine = 1)565 ->and($classController->getEndLine = 12)566 ->and($class = new \mock\reflectionClass(uniqid(), $classController))567 ->and($methodController = new mock\controller())568 ->and($methodController->__construct = function() {})569 ->and($methodController->getName = function() { return uniqid(); })570 ->and($methodController->isAbstract = false)571 ->and($methodController->getFileName = function() use (& $classFile) { return $classFile; })572 ->and($methodController->getDeclaringClass = function() use ($class) { return $class; })573 ->and($methodController->getStartLine = 4)574 ->and($methodController->getEndLine = 8)575 ->and($classController->getMethods = array(new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)))576 ->and($classFile = uniqid())577 ->and($className = uniqid())578 ->and($xdebugData = array(579 $classFile =>580 array(581 3 => -2,582 4 => -1,583 5 => -1,584 6 => -1,585 7 => -1,586 8 => -2,587 9 => -2588 )589 )590 )591 ->and($coverage = new testedClass())592 ->and($coverage->setReflectionClassFactory(function() use ($class) { return $class; }))593 ->and($coverage->addXdebugDataForTest($this, $xdebugData))594 ->then595 ->array($coverage->getClasses())->isEqualTo(array($className => $classFile))596 ;597 }598 public function testGetValue()599 {600 $this601 ->if($classController = new mock\controller())602 ->and($classController->disableMethodChecking())603 ->and($classController->__construct = function() {})604 ->and($classController->getName = function() use (& $className) { return $className; })605 ->and($classController->getFileName = function() use (& $classFile) { return $classFile; })606 ->and($classController->getTraits = array())607 ->and($classController->getStartLine = 1)608 ->and($classController->getEndLine = 12)609 ->and($class = new \mock\reflectionClass(uniqid(), $classController))610 ->and($methodController = new mock\controller())611 ->and($methodController->__construct = function() {})612 ->and($methodController->getName = function() { return uniqid(); })613 ->and($methodController->isAbstract = false)614 ->and($methodController->getFileName = function() use (& $classFile) { return $classFile; })615 ->and($methodController->getDeclaringClass = function() use ($class) { return $class; })616 ->and($methodController->getStartLine = 4)617 ->and($methodController->getEndLine = 8)618 ->and($classController->getMethods = array(new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)))619 ->and($classFile = uniqid())620 ->and($className = uniqid())621 ->and($xdebugData = array(622 $classFile =>623 array(624 3 => -2,625 4 => -1,626 5 => -1,627 6 => -1,628 7 => -1,629 8 => -2,630 9 => -2631 ),632 uniqid() =>633 array(634 5 => 2,635 6 => 3,636 7 => 4,637 8 => 3,638 9 => 2639 )640 )641 )642 ->and($coverage = new testedClass())643 ->and($coverage->setReflectionClassFactory(function() use ($class) { return $class; }))644 ->and($coverage->addXdebugDataForTest($this, $xdebugData))645 ->then646 ->float($coverage->getValue())->isEqualTo(0.0)647 ->if($xdebugData = array(648 $classFile =>649 array(650 3 => -2,651 4 => 1,652 5 => -1,653 6 => -1,654 7 => -1,655 8 => -2,656 9 => -1657 ),658 uniqid() =>659 array(660 5 => 2,661 6 => 3,662 7 => 4,663 8 => 3,664 9 => 2665 )666 )667 )668 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))669 ->then670 ->float($coverage->getValue())->isEqualTo(1 / 4)671 ->if($xdebugData = array(672 $classFile =>673 array(674 3 => -2,675 4 => 1,676 5 => -1,677 6 => -1,678 7 => 1,679 8 => -2,680 9 => -1681 ),682 uniqid() =>683 array(684 5 => 2,685 6 => 3,686 7 => 4,687 8 => 3,688 9 => 2689 )690 )691 )692 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))693 ->then694 ->float($coverage->getValue())->isEqualTo(2 / 4)695 ->if($xdebugData = array(696 $classFile =>697 array(698 3 => -2,699 4 => 1,700 5 => 1,701 6 => 1,702 7 => 1,703 8 => -2,704 9 => -1705 ),706 uniqid() =>707 array(708 5 => 2,709 6 => 3,710 7 => 4,711 8 => 3,712 9 => 2713 )714 )715 )716 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))717 ->then718 ->float($coverage->getValue())->isEqualTo(1.0)719 ;720 }721 public function testGetValueForClass()722 {723 $this724 ->if($coverage = new testedClass())725 ->then726 ->variable($coverage->getValueForClass(uniqid()))->isNull()727 ->if($classController = new mock\controller())728 ->and($classController->disableMethodChecking())729 ->and($classController->__construct = function() {})730 ->and($classController->getName = function() use (& $className) { return $className; })731 ->and($classController->getFileName = function() use (& $classFile) { return $classFile; })732 ->and($classController->getTraits = array())733 ->and($classController->getStartLine = 1)734 ->and($classController->getEndLine = 12)735 ->and($class = new \mock\reflectionClass(uniqid(), $classController))736 ->and($methodController = new mock\controller())737 ->and($methodController->__construct = function() {})738 ->and($methodController->getName = function() { return uniqid(); })739 ->and($methodController->isAbstract = false)740 ->and($methodController->getFileName = function() use (& $classFile) { return $classFile; })741 ->and($methodController->getDeclaringClass = function() use ($class) { return $class; })742 ->and($methodController->getStartLine = 4)743 ->and($methodController->getEndLine = 8)744 ->and($classController->getMethods = array(new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)))745 ->and($classFile = uniqid())746 ->and($className = uniqid())747 ->and($xdebugData = array(748 $classFile =>749 array(750 3 => -2,751 4 => -1,752 5 => -1,753 6 => -1,754 7 => -1,755 8 => -2,756 9 => -2757 ),758 uniqid() =>759 array(760 5 => 2,761 6 => 3,762 7 => 4,763 8 => 3,764 9 => 2765 )766 )767 )768 ->and($coverage = new testedClass())769 ->and($coverage->setReflectionClassFactory(function() use ($class) { return $class; }))770 ->and($coverage->addXdebugDataForTest($this, $xdebugData))771 ->then772 ->variable($coverage->getValueForClass(uniqid()))->isNull()773 ->float($coverage->getValueForClass($className))->isEqualTo(0.0)774 ->if($xdebugData = array(775 $classFile =>776 array(777 3 => -2,778 4 => 1,779 5 => -1,780 6 => -1,781 7 => -1,782 8 => -2,783 9 => -1784 ),785 uniqid() =>786 array(787 5 => 2,788 6 => 3,789 7 => 4,790 8 => 3,791 9 => 2792 )793 )794 )795 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))796 ->then797 ->variable($coverage->getValueForClass(uniqid()))->isNull()798 ->float($coverage->getValueForClass($className))->isEqualTo(1 / 4)799 ->if($xdebugData = array(800 $classFile =>801 array(802 3 => -2,803 4 => 1,804 5 => -1,805 6 => -1,806 7 => 1,807 8 => -2,808 9 => -1809 ),810 uniqid() =>811 array(812 5 => 2,813 6 => 3,814 7 => 4,815 8 => 3,816 9 => 2817 )818 )819 )820 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))821 ->then822 ->variable($coverage->getValueForClass(uniqid()))->isNull()823 ->float($coverage->getValueForClass($className))->isEqualTo(2 / 4)824 ->if($xdebugData = array(825 $classFile =>826 array(827 3 => -2,828 4 => 1,829 5 => 1,830 6 => 1,831 7 => 1,832 8 => -2,833 9 => -1834 ),835 uniqid() =>836 array(837 5 => 2,838 6 => 3,839 7 => 4,840 8 => 3,841 9 => 2842 )843 )844 )845 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))846 ->then847 ->variable($coverage->getValueForClass(uniqid()))->isNull()848 ->float($coverage->getValueForClass($className))->isEqualTo(1.0)849 ;850 }851 public function testGetCoverageForClass()852 {853 $this854 ->if($coverage = new testedClass())855 ->then856 ->array($coverage->getCoverageForClass(uniqid()))->isEmpty()857 ->if($classController = new mock\controller())858 ->and($classController->disableMethodChecking())859 ->and($classController->__construct = function() {})860 ->and($classController->getName = function() use (& $className) { return $className; })861 ->and($classController->getFileName = function() use (& $classFile) { return $classFile; })862 ->and($classController->getTraits = array())863 ->and($classController->getStartLine = 1)864 ->and($classController->getEndLine = 12)865 ->and($class = new \mock\reflectionClass(uniqid(), $classController))866 ->and($methodController = new mock\controller())867 ->and($methodController->__construct = function() {})868 ->and($methodController->getName = function() use (& $methodName) { return $methodName; })869 ->and($methodController->isAbstract = false)870 ->and($methodController->getFileName = function() use (& $classFile) { return $classFile; })871 ->and($methodController->getDeclaringClass = function() use ($class) { return $class; })872 ->and($methodController->getStartLine = 4)873 ->and($methodController->getEndLine = 8)874 ->and($classController->getMethods = array(new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)))875 ->and($classFile = uniqid())876 ->and($className = uniqid())877 ->and($methodName = uniqid())878 ->and($xdebugData = array(879 $classFile =>880 array(881 3 => -2,882 4 => 1,883 5 => -1,884 6 => -1,885 7 => -1,886 8 => -2,887 9 => -1888 ),889 uniqid() =>890 array(891 5 => 2,892 6 => 3,893 7 => 4,894 8 => 3,895 9 => 2896 )897 )898 )899 ->and($expected = array(900 $methodName =>901 array(902 4 => 1,903 5 => -1,904 6 => -1,905 7 => -1,906 8 => -2,907 )908 )909 )910 ->and($coverage->setReflectionClassFactory(function() use ($class) { return $class; }))911 ->and($coverage->addXdebugDataForTest($this, $xdebugData))912 ->then913 ->array($coverage->getCoverageForClass($className))->isEqualTo($expected)914 ;915 }916 public function testGetNumberOfCoverableLinesInClass()917 {918 $this919 ->if($coverage = new testedClass())920 ->then921 ->integer($coverage->getNumberOfCoverableLinesInClass(uniqid()))->isZero()922 ->if($classController = new mock\controller())923 ->and($classController->disableMethodChecking())924 ->and($classController->__construct = function() {})925 ->and($classController->getName = function() use (& $className) { return $className; })926 ->and($classController->getFileName = function() use (& $classFile) { return $classFile; })927 ->and($classController->getTraits = array())928 ->and($classController->getStartLine = 1)929 ->and($classController->getEndLine = 12)930 ->and($class = new \mock\reflectionClass(uniqid(), $classController))931 ->and($methodController = new mock\controller())932 ->and($methodController->__construct = function() {})933 ->and($methodController->getName = function() use (& $methodName) { return $methodName; })934 ->and($methodController->isAbstract = false)935 ->and($methodController->getFileName = function() use (& $classFile) { return $classFile; })936 ->and($methodController->getDeclaringClass = function() use ($class) { return $class; })937 ->and($methodController->getStartLine = 4)938 ->and($methodController->getEndLine = 8)939 ->and($classController->getMethods = array(new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)))940 ->and($classFile = uniqid())941 ->and($className = uniqid())942 ->and($methodName = uniqid())943 ->and($xdebugData = array(944 $classFile =>945 array(946 3 => -2,947 4 => 1,948 5 => -1,949 6 => -1,950 7 => -1,951 8 => -2,952 9 => -1953 ),954 uniqid() =>955 array(956 5 => 2,957 6 => 3,958 7 => 4,959 8 => 3,960 9 => 2961 )962 )963 )964 ->and($coverage->setReflectionClassFactory(function() use ($class) { return $class; }))965 ->and($coverage->addXdebugDataForTest($this, $xdebugData))966 ->then967 ->integer($coverage->getNumberOfCoverableLinesInClass($className))->isEqualTo(4)968 ;969 }970 public function testGetNumberOfCoveredLinesInClass()971 {972 $this973 ->if($coverage = new testedClass())974 ->then975 ->integer($coverage->getNumberOfCoveredLinesInClass(uniqid()))->isZero()976 ->if($classController = new mock\controller())977 ->and($classController->disableMethodChecking())978 ->and($classController->__construct = function() {})979 ->and($classController->getName = function() use (& $className) { return $className; })980 ->and($classController->getFileName = function() use (& $classFile) { return $classFile; })981 ->and($classController->getTraits = array())982 ->and($classController->getStartLine = 1)983 ->and($classController->getEndLine = 12)984 ->and($class = new \mock\reflectionClass(uniqid(), $classController))985 ->and($methodController = new mock\controller())986 ->and($methodController->__construct = function() {})987 ->and($methodController->getName = function() use (& $methodName) { return $methodName; })988 ->and($methodController->isAbstract = false)989 ->and($methodController->getFileName = function() use (& $classFile) { return $classFile; })990 ->and($methodController->getDeclaringClass = function() use ($class) { return $class; })991 ->and($methodController->getStartLine = 4)992 ->and($methodController->getEndLine = 8)993 ->and($classController->getMethods = array(new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)))994 ->and($classFile = uniqid())995 ->and($className = uniqid())996 ->and($methodName = uniqid())997 ->and($xdebugData = array(998 $classFile =>999 array(1000 3 => -2,1001 4 => 1,1002 5 => -1,1003 6 => -1,1004 7 => -1,1005 8 => -2,1006 9 => -11007 ),1008 uniqid() =>1009 array(1010 5 => 2,1011 6 => 3,1012 7 => 4,1013 8 => 3,1014 9 => 21015 )1016 )1017 )1018 ->and($coverage->setReflectionClassFactory(function() use ($class) { return $class; }))1019 ->and($coverage->addXdebugDataForTest($this, $xdebugData))1020 ->then1021 ->integer($coverage->getNumberOfCoveredLinesInClass($className))->isEqualTo(1)1022 ;1023 }1024 public function testGetValueForMethod()1025 {1026 $this1027 ->if($coverage = new testedClass())1028 ->then1029 ->variable($coverage->getValueForMethod(uniqid(), uniqid()))->isNull()1030 ->if($classController = new mock\controller())1031 ->and($classController->disableMethodChecking())1032 ->and($classController->__construct = function() {})1033 ->and($classController->getName = function() use (& $className) { return $className; })1034 ->and($classController->getFileName = function() use (& $classFile) { return $classFile; })1035 ->and($classController->getTraits = array())1036 ->and($classController->getStartLine = 1)1037 ->and($classController->getEndLine = 12)1038 ->and($class = new \mock\reflectionClass(uniqid(), $classController))1039 ->and($methodController = new mock\controller())1040 ->and($methodController->__construct = function() {})1041 ->and($methodController->getName = function() use (& $methodName) { return $methodName; })1042 ->and($methodController->isAbstract = false)1043 ->and($methodController->getFileName = function() use (& $classFile) { return $classFile; })1044 ->and($methodController->getDeclaringClass = function() use ($class) { return $class; })1045 ->and($methodController->getStartLine = 4)1046 ->and($methodController->getEndLine = 8)1047 ->and($classController->getMethods = array(new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)))1048 ->and($classFile = uniqid())1049 ->and($className = uniqid())1050 ->and($methodName = uniqid())1051 ->and($xdebugData = array(1052 $classFile =>1053 array(1054 3 => -2,1055 4 => -1,1056 5 => -1,1057 6 => -1,1058 7 => -1,1059 8 => -2,1060 9 => -21061 ),1062 uniqid() =>1063 array(1064 5 => 2,1065 6 => 3,1066 7 => 4,1067 8 => 3,1068 9 => 21069 )1070 )1071 )1072 ->and($coverage->setReflectionClassFactory(function() use ($class) { return $class; }))1073 ->and($coverage->addXdebugDataForTest($this, $xdebugData))1074 ->then1075 ->variable($coverage->getValueForMethod(uniqid(), uniqid()))->isNull()1076 ->variable($coverage->getValueForMethod($className, uniqid()))->isNull()1077 ->float($coverage->getValueForMethod($className, $methodName))->isEqualTo(0.0)1078 ->if($xdebugData = array(1079 $classFile =>1080 array(1081 3 => -2,1082 4 => 1,1083 5 => -1,1084 6 => -1,1085 7 => -1,1086 8 => -2,1087 9 => -11088 ),1089 uniqid() =>1090 array(1091 5 => 2,1092 6 => 3,1093 7 => 4,1094 8 => 3,1095 9 => 21096 )1097 )1098 )1099 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))1100 ->then1101 ->variable($coverage->getValueForMethod(uniqid(), uniqid()))->isNull()1102 ->variable($coverage->getValueForMethod($className, uniqid()))->isNull()1103 ->float($coverage->getValueForMethod($className, $methodName))->isEqualTo(1 / 4)1104 ->if($xdebugData = array(1105 $classFile =>1106 array(1107 3 => -2,1108 4 => 1,1109 5 => -1,1110 6 => -1,1111 7 => 1,1112 8 => -2,1113 9 => -11114 ),1115 uniqid() =>1116 array(1117 5 => 2,1118 6 => 3,1119 7 => 4,1120 8 => 3,1121 9 => 21122 )1123 )1124 )1125 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))1126 ->then1127 ->variable($coverage->getValueForMethod(uniqid(), uniqid()))->isNull()1128 ->variable($coverage->getValueForMethod($className, uniqid()))->isNull()1129 ->float($coverage->getValueForMethod($className, $methodName))->isEqualTo(2 / 4)1130 ->if($xdebugData = array(1131 $classFile =>1132 array(1133 3 => -2,1134 4 => 1,1135 5 => 1,1136 6 => 1,1137 7 => 1,1138 8 => -2,1139 9 => -11140 ),1141 uniqid() =>1142 array(1143 5 => 2,1144 6 => 3,1145 7 => 4,1146 8 => 3,1147 9 => 21148 )1149 )1150 )1151 ->and($coverage->reset()->addXdebugDataForTest($this, $xdebugData))1152 ->then1153 ->variable($coverage->getValueForMethod(uniqid(), uniqid()))->isNull()1154 ->variable($coverage->getValueForMethod($className, uniqid()))->isNull()1155 ->float($coverage->getValueForMethod($className, $methodName))->isEqualTo(1.0)1156 ;1157 }1158 public function testGetCoverageForMethod()1159 {1160 $this1161 ->if($coverage = new testedClass())1162 ->then1163 ->array($coverage->getCoverageForClass(uniqid()))->isEmpty()1164 ->if($classController = new mock\controller())1165 ->and($classController->disableMethodChecking())1166 ->and($classController->__construct = function() {})1167 ->and($classController->getName = function() use (& $className) { return $className; })1168 ->and($classController->getFileName = function() use (& $classFile) { return $classFile; })1169 ->and($classController->getTraits = array())1170 ->and($classController->getStartLine = 1)1171 ->and($classController->getEndLine = 12)1172 ->and($class = new \mock\reflectionClass(uniqid(), $classController))1173 ->and($methodController = new mock\controller())1174 ->and($methodController->__construct = function() {})1175 ->and($methodController->getName = function() use (& $methodName) { return $methodName; })1176 ->and($methodController->isAbstract = false)1177 ->and($methodController->getFileName = function() use (& $classFile) { return $classFile; })1178 ->and($methodController->getDeclaringClass = function() use ($class) { return $class; })1179 ->and($methodController->getStartLine = 4)1180 ->and($methodController->getEndLine = 8)1181 ->and($classController->getMethods = array(new \mock\reflectionMethod(uniqid(), uniqid(), $methodController)))1182 ->and($classFile = uniqid())1183 ->and($className = uniqid())1184 ->and($methodName = uniqid())1185 ->and($xdebugData = array(1186 $classFile =>1187 array(1188 3 => -2,1189 4 => 1,1190 5 => -1,1191 6 => -1,1192 7 => -1,1193 8 => -2,1194 9 => -11195 ),1196 uniqid() =>1197 array(1198 5 => 2,1199 6 => 3,1200 7 => 4,1201 8 => 3,1202 9 => 21203 )1204 )1205 )1206 ->and($expected = array(1207 4 => 1,1208 5 => -1,1209 6 => -1,1210 7 => -1,1211 8 => -2,1212 )1213 )1214 ->and($coverage = new testedClass())1215 ->and($coverage->setReflectionClassFactory(function() use ($class) { return $class; }))1216 ->and($coverage->addXdebugDataForTest($this, $xdebugData))1217 ->then1218 ->array($coverage->getCoverageForMethod($className, $methodName))->isEqualTo($expected)1219 ;1220 }1221 public function testExcludeClass()1222 {1223 $this1224 ->if($coverage = new testedClass())1225 ->then1226 ->object($coverage->excludeClass($class = uniqid()))->isIdenticalTo($coverage)1227 ->array($coverage->getExcludedClasses())->isEqualTo(array($class))1228 ->object($coverage->excludeClass($otherClass = rand(1, PHP_INT_MAX)))->isIdenticalTo($coverage)1229 ->array($coverage->getExcludedClasses())->isEqualTo(array($class, (string) $otherClass))1230 ->object($coverage->excludeClass($class))->isIdenticalTo($coverage)1231 ->array($coverage->getExcludedClasses())->isEqualTo(array($class, (string) $otherClass))1232 ;1233 }1234 public function testExcludeNamespace()1235 {1236 $this1237 ->if($coverage = new testedClass())1238 ->then1239 ->object($coverage->excludeNamespace($namespace = uniqid()))->isIdenticalTo($coverage)1240 ->array($coverage->getExcludedNamespaces())->isEqualTo(array($namespace))1241 ->object($coverage->excludeNamespace($otherNamespace = rand(1, PHP_INT_MAX)))->isIdenticalTo($coverage)1242 ->array($coverage->getExcludedNamespaces())->isEqualTo(array($namespace, (string) $otherNamespace))1243 ->object($coverage->excludeNamespace($namespace))->isIdenticalTo($coverage)1244 ->array($coverage->getExcludedNamespaces())->isEqualTo(array($namespace, (string) $otherNamespace))1245 ->object($coverage->excludeNamespace('\\' . ($anotherNamespace = uniqid()) . '\\'))->isIdenticalTo($coverage)1246 ->array($coverage->getExcludedNamespaces())->isEqualTo(array($namespace, (string) $otherNamespace, $anotherNamespace))1247 ;1248 }1249 public function testExcludeDirectory()1250 {1251 $this1252 ->if($coverage = new testedClass())1253 ->then1254 ->object($coverage->excludeDirectory($directory = uniqid()))->isIdenticalTo($coverage)1255 ->array($coverage->getExcludedDirectories())->isEqualTo(array($directory))1256 ->object($coverage->excludeDirectory($otherDirectory = rand(1, PHP_INT_MAX)))->isIdenticalTo($coverage)1257 ->array($coverage->getExcludedDirectories())->isEqualTo(array($directory, (string) $otherDirectory))1258 ->object($coverage->excludeDirectory($directory))->isIdenticalTo($coverage)1259 ->array($coverage->getExcludedDirectories())->isEqualTo(array($directory, (string) $otherDirectory))1260 ->object($coverage->excludeDirectory(($anotherDirectory = (DIRECTORY_SEPARATOR . uniqid())) . DIRECTORY_SEPARATOR))->isIdenticalTo($coverage)1261 ->array($coverage->getExcludedDirectories())->isEqualTo(array($directory, (string) $otherDirectory, $anotherDirectory))1262 ;1263 }1264 public function testIsInExcludedClasses()1265 {1266 $this1267 ->if($coverage = new testedClass())1268 ->then1269 ->boolean($coverage->isInExcludedClasses(uniqid()))->isFalse()1270 ->if($coverage->excludeClass($class = uniqid()))1271 ->then1272 ->boolean($coverage->isInExcludedClasses(uniqid()))->isFalse()1273 ->boolean($coverage->isInExcludedClasses($class))->isTrue()1274 ;1275 }...

Full Screen

Full Screen

getExcludedDirectories

Using AI Code Generation

copy

Full Screen

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

Full Screen

Full Screen

getExcludedDirectories

Using AI Code Generation

copy

Full Screen

1$coverage = new PHP_CodeCoverage();2$excludedDirectories = $coverage->getExcludedDirectories();3var_dump($excludedDirectories);4$coverage = new PHP_CodeCoverage();5$coverage->setExcludedDirectories(array('path1', 'path2'));6$excludedDirectories = $coverage->getExcludedDirectories();7var_dump($excludedDirectories);8$coverage = new PHP_CodeCoverage();9$excludedFiles = $coverage->getExcludedFiles();10var_dump($excludedFiles);11$coverage = new PHP_CodeCoverage();12$coverage->setExcludedFiles(array('path1', 'path2'));13$excludedFiles = $coverage->getExcludedFiles();14var_dump($excludedFiles);15$coverage = new PHP_CodeCoverage();16$filter = $coverage->getFilter();17var_dump($filter);18$coverage = new PHP_CodeCoverage();19$filter = new PHP_CodeCoverage_Filter();20$coverage->setFilter($filter);21var_dump($filter);22$coverage = new PHP_CodeCoverage();23$coverage->start('test');24$coverage->stop();25$report = $coverage->getReport();26var_dump($report);27$coverage = new PHP_CodeCoverage();28$coverage->start('test');29$coverage->stop();30$coverage->setReport(new PHP_CodeCoverage_Report_Clover());31$report = $coverage->getReport();32var_dump($report);33$coverage = new PHP_CodeCoverage();34$coverage->start('test');35$coverage->stop();36$tests = $coverage->getTests();37var_dump($tests);38$coverage = new PHP_CodeCoverage();39$coverage->start('test');40$coverage->stop();

Full Screen

Full Screen

getExcludedDirectories

Using AI Code Generation

copy

Full Screen

1$coverage = new coverage();2$directories = $coverage->getExcludedDirectories();3var_dump($directories);4$coverage = new coverage();5$files = $coverage->getExcludedFiles();6var_dump($files);7$coverage = new coverage();8$files = $coverage->getExcludedFiles();9var_dump($files);10$coverage = new coverage();11$files = $coverage->getExcludedFiles();12var_dump($files);13$coverage = new coverage();14$files = $coverage->getExcludedFiles();15var_dump($files);16$coverage = new coverage();17$files = $coverage->getExcludedFiles();18var_dump($files);19$coverage = new coverage();20$files = $coverage->getExcludedFiles();21var_dump($files);22$coverage = new coverage();23$files = $coverage->getExcludedFiles();24var_dump($files);25$coverage = new coverage();26$files = $coverage->getExcludedFiles();27var_dump($files);28$coverage = new coverage();29$files = $coverage->getExcludedFiles();30var_dump($files);31$coverage = new coverage();32$files = $coverage->getExcludedFiles();33var_dump($files);34$coverage = new coverage();35$files = $coverage->getExcludedFiles();36var_dump($files);

Full Screen

Full Screen

getExcludedDirectories

Using AI Code Generation

copy

Full Screen

1$coverage = new Coverage();2$excludedDirs = $coverage->getExcludedDirectories();3var_dump($excludedDirs);4$coverage = new Coverage();5$excludedFiles = $coverage->getExcludedFiles();6var_dump($excludedFiles);7$coverage = new Coverage();8$includedFiles = $coverage->getIncludedFiles();9var_dump($includedFiles);10$coverage = new Coverage();11$report = $coverage->getReport();12var_dump($report);13$coverage = new Coverage();14$reports = $coverage->getReports();15var_dump($reports);16$coverage = new Coverage();17$testedClasses = $coverage->getTestedClasses();18var_dump($testedClasses);19$coverage = new Coverage();20$testedFunctions = $coverage->getTestedFunctions();21var_dump($testedFunctions);22$coverage = new Coverage();23$testedMethods = $coverage->getTestedMethods();24var_dump($testedMethods);25$coverage = new Coverage();26$testedTraits = $coverage->getTestedTraits();27var_dump($testedTraits);28$coverage = new Coverage();29$testedUnits = $coverage->getTestedUnits();30var_dump($testedUnits);31$coverage = new Coverage();32$unintentionallyCoveredSubclasses = $coverage->getUnintentionallyCoveredSubclasses();33var_dump($unintentionallyCoveredSubclasses);

Full Screen

Full Screen

getExcludedDirectories

Using AI Code Generation

copy

Full Screen

1require_once 'PHPUnit/Util/Filter.php';2require_once 'PHPUnit/Util/PHP.php';3require_once 'PHPUnit/Util/PHP/Default.php';4require_once 'PHPUnit/Util/PHP/CodeCoverage.php';5$coverage = new PHP_CodeCoverage;6$coverage->setProcessUncoveredFilesFromWhitelist(false);7$coverage->setTest(PHPUnit_Util_PHP_Default::factory());8$coverage->setWhitelist(array('2.php'));9$coverage->start('1.php');10$coverage->stop();11$coverage->getExcludedDirectories();12require_once 'PHPUnit/Util/Filter.php';13require_once 'PHPUnit/Util/PHP.php';14require_once 'PHPUnit/Util/PHP/Default.php';15require_once 'PHPUnit/Util/PHP/CodeCoverage.php';16$coverage = new PHP_CodeCoverage;17$coverage->setProcessUncoveredFilesFromWhitelist(false);18$coverage->setTest(PHPUnit_Util_PHP_Default::factory());19$coverage->setWhitelist(array('2.php'));20$coverage->start('1.php');21$coverage->stop();22$coverage->excludeDirectoriesFromWhitelist(array('folder'));23require_once 'PHPUnit/Util/Filter.php';24require_once 'PHPUnit/Util/PHP.php';25require_once 'PHPUnit/Util/PHP/Default.php';26require_once 'PHPUnit/Util/PHP/CodeCoverage.php';27$coverage = new PHP_CodeCoverage;28$coverage->setProcessUncoveredFilesFromWhitelist(false);29$coverage->setTest(PHPUnit_Util_PHP_Default::factory());30$coverage->setWhitelist(array('2.php'));31$coverage->start('1.php');32$coverage->stop();33$coverage->includeDirectoriesInWhitelist(array('folder'));

Full Screen

Full Screen

getExcludedDirectories

Using AI Code Generation

copy

Full Screen

1$coverage = new Coverage();2$exclude = $coverage->getExcludedDirectories();3var_dump($exclude);4$coverage = new Coverage();5$exclude = $coverage->getExcludedDirectories();6var_dump($exclude);7$coverage = new Coverage();8$exclude = $coverage->getExcludedDirectories();9var_dump($exclude);10$coverage = new Coverage();11$exclude = $coverage->getExcludedDirectories();12var_dump($exclude);13$coverage = new Coverage();14$exclude = $coverage->getExcludedDirectories();15var_dump($exclude);16$coverage = new Coverage();17$exclude = $coverage->getExcludedDirectories();18var_dump($exclude);19$coverage = new Coverage();20$exclude = $coverage->getExcludedDirectories();21var_dump($exclude);22$coverage = new Coverage();23$exclude = $coverage->getExcludedDirectories();24var_dump($exclude);25$coverage = new Coverage();26$exclude = $coverage->getExcludedDirectories();27var_dump($exclude);28$coverage = new Coverage();29$exclude = $coverage->getExcludedDirectories();30var_dump($exclude);31$coverage = new Coverage();32$exclude = $coverage->getExcludedDirectories();33var_dump($exclude);34$coverage = new Coverage();35$exclude = $coverage->getExcludedDirectories();36var_dump($exclude);

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 getExcludedDirectories code on LambdaTest Cloud Grid

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