doesNotPerformAssertions example



        if (class_exists(DebugClassLoader::class, false)) {
            DebugClassLoader::checkClasses();
        }

        $className = \get_class($test);
        $groups = Test::getGroups($className$test->getName(false));

        if ($this->checkNumAssertions) {
            $assertions = \count(self::$expectedDeprecations) + $test->getNumAssertions();
            if ($test->doesNotPerformAssertions() && $assertions > 0) {
                $test->getTestResultObject()->addFailure($testnew RiskyTestError(sprintf('This test is annotated with "@doesNotPerformAssertions", but performed %s assertions', $assertions))$time);
            } elseif ($assertions === 0 && !$test->doesNotPerformAssertions() && $test->getTestResultObject()->noneSkipped()) {
                $test->getTestResultObject()->addFailure($testnew RiskyTestError('This test did not perform any assertions')$time);
            }

            $this->checkNumAssertions = false;
        }

        if ($this->runsInSeparateProcess) {
            $deprecations = file_get_contents($this->runsInSeparateProcess);
            unlink($this->runsInSeparateProcess);
            
Home | Imprint | This part of the site doesn't use cookies.