Make developer commands runnable without install

This commit is contained in:
Romain Neutron
2013-07-16 19:36:18 +02:00
parent 2b6a284e9c
commit 303aadad57
14 changed files with 106 additions and 116 deletions

View File

@@ -18,7 +18,9 @@ class CompilerTest extends \PhraseanetPHPUnitAbstract
{
public function testCompileSuccess()
{
$recessDriver = $this->getMock('Alchemy\BinaryDriver\BinaryInterface');
$recessDriver = $this->getMockBuilder('Alchemy\Phrasea\Utilities\Less\RecessDriver')
->disableOriginalConstructor()
->getMock();
$recessDriver->expects($this->once())->method('command');
$filesystem = $this->getMock('Symfony\Component\Filesystem\Filesystem');
@@ -30,18 +32,14 @@ class CompilerTest extends \PhraseanetPHPUnitAbstract
$compiler->compile(__DIR__ . '/output.css', __FILE__);
}
public function testCreate()
{
$compiler = Compiler::create(self::$DI['app']);
$this->assertInstanceOf('Alchemy\Phrasea\Utilities\Less\Compiler', $compiler);
}
/**
/**
* @expectedException Alchemy\Phrasea\Exception\RuntimeException
*/
public function testCompileFileNotExists()
{
$recessDriver = $this->getMock('Alchemy\BinaryDriver\BinaryInterface');
$recessDriver = $this->getMockBuilder('Alchemy\Phrasea\Utilities\Less\RecessDriver')
->disableOriginalConstructor()
->getMock();
$filesystem = $this->getMock('Symfony\Component\Filesystem\Filesystem');
$filesystem->expects($this->once())->method('mkdir');
@@ -56,7 +54,10 @@ class CompilerTest extends \PhraseanetPHPUnitAbstract
*/
public function testCompileExecutionFailure()
{
$recessDriver = $this->getMock('Alchemy\BinaryDriver\BinaryInterface');
$recessDriver = $this->getMockBuilder('Alchemy\Phrasea\Utilities\Less\RecessDriver')
->disableOriginalConstructor()
->getMock();
$recessDriver->expects($this->once())->method('command')->will(
$this->throwException(new ExecutionFailureException())
);

View File

@@ -1,31 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Tests\Phrasea\Utilities\Less;
use Alchemy\Phrasea\Utilities\Less\RecessDriver;
class RecessDriverTest extends \PHPUnit_Framework_TestCase
{
public function testGetCreate()
{
$recessDriver = RecessDriver::create();
$this->assertInstanceOf('Alchemy\BinaryDriver\BinaryInterface', $recessDriver);
}
public function testGetName()
{
$recessDriver = RecessDriver::create();
$this->assertEquals('recess', $recessDriver->getName());
}
}