forked from sebastianbergmann/dbunit
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
76 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of DbUnit. | ||
* | ||
* (c) Sebastian Bergmann <sebastian@phpunit.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace PHPUnit\DbUnit\Tests\DataSet; | ||
|
||
use PHPUnit\DbUnit\DataSet\DefaultTable; | ||
use PHPUnit\DbUnit\DataSet\DefaultTableIterator; | ||
use PHPUnit\DbUnit\DataSet\DefaultTableMetadata; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class DefaultTableIteratorTest extends TestCase | ||
{ | ||
public function testKey(): void | ||
{ | ||
$tables = [ | ||
new DefaultTable( | ||
new DefaultTableMetadata( | ||
'table1', | ||
['id', 'column11', 'column12', 'column13'], | ||
['id'] | ||
) | ||
), | ||
new DefaultTable( | ||
new DefaultTableMetadata( | ||
'table2', | ||
['id', 'column21', 'column22', 'column23'], | ||
['id'] | ||
) | ||
), | ||
]; | ||
|
||
$iterator = new DefaultTableIterator($tables); | ||
|
||
self::assertSame('table1', $iterator->key()); | ||
|
||
$iterator->next(); | ||
|
||
self::assertSame('table2', $iterator->key()); | ||
} | ||
} |