public function test__construct() { $this->if($file = new writers\file())->then->object($file->getAdapter())->isInstanceOf('mageekguy\\atoum\\adapter')->string($file->getFilename())->isEqualTo('atoum.log')->if($adapter = new atoum\test\adapter())->and($adapter->fopen = function () { })->and($adapter->fclose = function () { })->and($file = new writers\file(null, $adapter))->then->object($file->getAdapter())->isIdenticalTo($adapter)->string($file->getFilename())->isEqualTo('atoum.log')->if($file = new writers\file('test.log'))->then->string($file->getFilename())->isEqualTo('test.log'); }
public function test__construct() { $this->if($file = new testedClass())->then->string($file->getFilename())->isEqualTo('atoum.log')->object($file->getAdapter())->isInstanceOf('mageekguy\\atoum\\adapter')->if($file = new testedClass(null, $adapter = new atoum\test\adapter()))->then->object($file->getAdapter())->isIdenticalTo($adapter)->string($file->getFilename())->isEqualTo('atoum.log')->adapter($file->getAdapter())->call('fopen')->never()->if($file = new testedClass($filename = uniqid()))->then->string($file->getFilename())->isEqualTo($filename)->object($file->getAdapter())->isInstanceOf('mageekguy\\atoum\\adapter'); }