コード例 #1
0
ファイル: JobTest.php プロジェクト: bergelmir/mutateme
    public function testGenerateReturnsPHPScriptRenderedWithCurrentRunnersSettingsAndSerialisedMutationArray()
    {
        $root = dirname(dirname(__FILE__)) . '/_files/root/base1';
        $src = $root . '/library';
        $tests = $root . '/tests';
        $runner = new \Mutateme\Runner\Base();
        $runner->setBaseDirectory($root)->setSourceDirectory($src)->setTestDirectory($tests)->setAdapterName('phpspec')->setAdapterOptions('--foo=bar');
        $job = new \Mutateme\Utility\Job($runner);
        $script = $job->generate(array('a', '1', new stdClass()));
        $expected = <<<EXPECTED
<?php
require_once 'Mutateme/Loader.php';
\$loader = new \\Mutateme\\Loader;
\$loader->register();
\$runner = new \\Mutateme\\Runner\\Mutation;
\$runner->setBaseDirectory('{$root}')
    ->setSourceDirectory('{$src}')
    ->setTestDirectory('{$tests}')
    ->setAdapterName('phpspec')
    ->setAdapterOptions('--foo=bar')
    ->setTimeout('120')
    ->setBootstrap('')
    ->setMutation('a:3:{i:0;s:1:"a";i:1;s:1:"1";i:2;O:8:"stdClass":0:{}}');
\$runner->execute();
EXPECTED;
        $this->assertEquals($expected, $script);
    }
コード例 #2
0
ファイル: BaseTest.php プロジェクト: bergelmir/mutateme
 public function testShouldCreateRunkitWrapperIfNotAvailable()
 {
     $runner = new \Mutateme\Runner\Base();
     $runner->setSourceDirectory($this->root);
     $this->assertTrue($runner->getRunkit() instanceof \Mutateme\Utility\Runkit);
 }