Logger is now required

This commit is contained in:
Romain Neutron 2012-05-25 16:21:16 +02:00
commit 5a33a99cb0
12 changed files with 217 additions and 98 deletions

View file

@ -2,6 +2,9 @@
namespace FFMpeg;
use Monolog\Logger;
use Monolog\Handler\NullHandler;
class BinaryTest extends \PHPUnit_Framework_TestCase
{
@ -9,14 +12,20 @@ class BinaryTest extends \PHPUnit_Framework_TestCase
* @var Binary
*/
protected $object;
protected $logger;
public function setUp()
{
$this->logger = new Logger('tests');
$this->logger->pushHandler(new NullHandler());
}
/**
* @covers FFMpeg\Binary::__construct
*/
public function testConstruct()
{
$binary = new BinaryTester('pretty_binary');
$binary = new BinaryTester('pretty_binary', new \Monolog\Logger('test'));
$binary = new BinaryTester('pretty_binary', $this->logger);
}
/**
@ -24,7 +33,7 @@ class BinaryTest extends \PHPUnit_Framework_TestCase
*/
public function testLoad()
{
BinaryTester::load();
BinaryTester::load($this->logger);
}
/**
@ -33,7 +42,7 @@ class BinaryTest extends \PHPUnit_Framework_TestCase
*/
public function testLoadWrongBinary()
{
BinaryTesterWrongBinary::load();
BinaryTesterWrongBinary::load($this->logger);
}
}

View file

@ -2,6 +2,9 @@
namespace FFMpeg;
use Monolog\Logger;
use Monolog\Handler\NullHandler;
class FFMpegTest extends \PHPUnit_Framework_TestCase
{
@ -14,11 +17,15 @@ class FFMpegTest extends \PHPUnit_Framework_TestCase
* @var FFProbe
*/
protected $probe;
protected $logger;
public function setUp()
{
$this->object = FFMpeg::load();
$this->probe = FFProbe::load();
$this->logger = new Logger('tests');
$this->logger->pushHandler(new NullHandler());
$this->object = FFMpeg::load($this->logger);
$this->probe = FFProbe::load($this->logger);
}
/**

View file

@ -2,6 +2,9 @@
namespace FFMpeg;
use Monolog\Logger;
use Monolog\Handler\NullHandler;
class FFProbeTest extends \PHPUnit_Framework_TestCase
{
@ -10,10 +13,14 @@ class FFProbeTest extends \PHPUnit_Framework_TestCase
* @var FFProbe
*/
protected $object;
protected $logger;
public function setUp()
{
$this->object = FFProbe::load();
$this->logger = new Logger('tests');
$this->logger->pushHandler(new NullHandler());
$this->object = FFProbe::load($this->logger);
}
/**