for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Ddeboer\DataImport\Tests\Writer;
use Ddeboer\DataImport\Writer\CallbackWriter;
/**
* @author Markus Bachmann <[email protected]>
*/
class CallbackWriterTest extends \PHPUnit_Framework_TestCase
{
public function testPrepare()
$callable = function(array $item) {
$item
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
return '';
};
$writer = new CallbackWriter($callable);
$writer->prepare();
}
public function testWriteItem()
$string = '';
$callable = function(array $item) use (&$string) {
$string = implode(',', array_values($item));
$writer->writeItem(array('foo' => 'bar', 'bar' => 'foo'));
$this->assertEquals('bar,foo', $string);
public function testFinish()
$writer->finish();
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.