mageekguy\atoum\tests\units\report\fields\test\event\tap::test__toStringWithUncompleteMethods PHP Method

test__toStringWithUncompleteMethods() public method

    public function test__toStringWithUncompleteMethods()
    {
        $this->mockGenerator->shunt('__construct')->if($score = new \mock\atoum\test\score())->and($test = new \mock\mageekguy\atoum\test())->and($this->calling($test)->getScore = $score)->and($this->calling($test)->getPath = $file = uniqid())->and($this->calling($test)->getClass = $class = uniqid())->and($this->calling($test)->getCurrentMethod[1] = $method = uniqid())->and($this->calling($test)->getCurrentMethod[2] = $otherMethod = uniqid())->and($this->calling($score)->getLastUncompleteMethod[1] = array('file' => $file, 'class' => $class, 'method' => $method, 'exitCode' => rand(1, PHP_INT_MAX), 'output' => $output = uniqid()))->and($this->calling($score)->getLastUncompleteMethod[2] = $this->calling($score)->getLastUncompleteMethod[3] = array('file' => $file, 'class' => $class, 'method' => $otherMethod, 'exitCode' => rand(1, PHP_INT_MAX), 'output' => $otherOutput = uniqid()))->and($this->calling($score)->getLastUncompleteMethod[4] = array('file' => $file, 'class' => $class, 'method' => $thirdMethod = uniqid(), 'exitCode' => $thirdExitCode = rand(1, PHP_INT_MAX), 'output' => null))->and($field = new testedClass())->then->castToString($field)->isEmpty()->if($field->handleEvent(atoum\runner::runStart, $test))->then->castToString($field)->isEmpty()->if($field->handleEvent(atoum\test::uncompleted, $test))->then->castToString($field)->isEqualTo('not ok 1 - ' . $class . '::' . $method . '()' . PHP_EOL . '# ' . $output . PHP_EOL . '# ' . $file . PHP_EOL)->if($field->handleEvent(atoum\test::uncompleted, $test))->then->castToString($field)->isEqualTo('not ok 2 - ' . $class . '::' . $otherMethod . '()' . PHP_EOL . '# ' . $otherOutput . PHP_EOL . '# ' . $file . PHP_EOL)->if($this->calling($score)->getLastErroredMethod = array('errorFile' => $file, 'class' => $class, 'method' => $otherMethod, 'type' => $errorType = 'error', 'message' => ($errorMessageFirstLine = 'line1') . PHP_EOL . ($errorMessageSecondLine = 'line2')))->and($field->handleEvent(atoum\test::uncompleted, $test))->then->castToString($field)->isEqualTo('not ok 3 - ' . $class . '::' . $otherMethod . '()' . PHP_EOL . '# ' . $errorType . ' : ' . $errorMessageFirstLine . PHP_EOL . '# ' . $errorMessageSecondLine . PHP_EOL . '# ' . $file . PHP_EOL)->if($field->handleEvent(atoum\test::uncompleted, $test))->then->castToString($field)->isEqualTo('not ok 4 - ' . $class . '::' . $thirdMethod . '()' . PHP_EOL . '# uncomplete method' . PHP_EOL . '# ' . $file . PHP_EOL);
    }