Actualización

This commit is contained in:
Xes
2025-04-10 12:24:57 +02:00
parent 8969cc929d
commit 45420b6f0d
39760 changed files with 4303286 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace Ddeboer\DataImport\Tests\Reader;
use Ddeboer\DataImport\Reader\CountableIteratorReader;
/**
* @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
*/
class CountableIteratorReaderTest extends \PHPUnit_Framework_TestCase
{
public function testCount()
{
$iterator = new \ArrayIterator([
[
'id' => 1,
'username' => 'john.doe',
'name' => 'John Doe',
],
]);
$reader = new CountableIteratorReader($iterator);
// We need to rewind the iterator
$reader->rewind();
$this->assertEquals(1, $reader->count());
}
public function testIteratorCount()
{
$reader = new CountableIteratorReader(new CountableIterator);
// We need to rewind the iterator
$reader->rewind();
$this->assertEquals(0, $reader->count());
}
}
class CountableIterator extends \EmptyIterator
{
}