Inheritance: extends Mutagenesis\Renderer\RendererAbstract
Esempio n. 1
0
    public function testRendersFinalReportWithEscapeesFromASingleMutant()
    {
        $expected = <<<EXPECTED


Score: 0%

1 Mutant born out of the mutagenic slime!

1 Mutant escaped; the integrity of your source code may be compromised by the following Mutants:

1)
Difference on Foo::bar() in /path/to/foo.php
===================================================================
diff1
    > test1output

Happy Hunting! Remember that some Mutants may just be Ghosts (or if you want to be boring, 'false positives').


EXPECTED;
        $mutable = $this->getMock('Mutagenesis\\Mutable', array('getMutantsEscaped', 'getMutantsCaptured'));
        $mutant = $this->getMock('Mutagenesis\\Mutant\\Mutant', array('getClassName', 'getMethodName', 'getFileName', 'getDiff'), array(), '', false);
        $mutant->expects($this->once())->method('getClassName')->will($this->returnValue('Foo'));
        $mutant->expects($this->once())->method('getMethodName')->will($this->returnValue('bar'));
        $mutant->expects($this->once())->method('getFileName')->will($this->returnValue('/path/to/foo.php'));
        $mutant->expects($this->once())->method('getDiff')->will($this->returnValue('diff1'));
        $mutable->expects($this->once())->method('getMutantsEscaped')->will($this->returnValue(array($mutant)));
        $mutables = array($mutable);
        $this->assertEquals($expected, $this->_renderer->renderReport(1, 0, 1, $mutables, 'test1output'));
    }