Included vendor/ to the project
This commit is contained in:
34
vendor/phpunit/dbunit/tests/Constraint/TableRowCountTest.php
vendored
Normal file
34
vendor/phpunit/dbunit/tests/Constraint/TableRowCountTest.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use PHPUnit\DbUnit\Constraint\TableRowCount;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
class Extensions_Database_Constraint_TableRowCountTest extends TestCase
|
||||
{
|
||||
public function testConstraint()
|
||||
{
|
||||
$constraint = new TableRowCount('name', 42);
|
||||
|
||||
$this->assertTrue($constraint->evaluate(42, '', true));
|
||||
$this->assertFalse($constraint->evaluate(24, '', true));
|
||||
$this->assertEquals('is equal to expected row count 42', $constraint->toString());
|
||||
|
||||
try {
|
||||
$this->assertThat(24, $constraint, '');
|
||||
} catch (ExpectationFailedException $e) {
|
||||
$this->assertEquals(
|
||||
'Failed asserting that 24 is equal to expected row count 42.',
|
||||
$e->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
38
vendor/phpunit/dbunit/tests/DB/DefaultDatabaseConnectionTest.php
vendored
Normal file
38
vendor/phpunit/dbunit/tests/DB/DefaultDatabaseConnectionTest.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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.
|
||||
*/
|
||||
use PHPUnit\DbUnit\Database\DefaultConnection;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class DefaultDatabaseConnectionTest extends TestCase
|
||||
{
|
||||
protected $db;
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
$this->db = new PDO('sqlite::memory:');
|
||||
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$this->db->exec('CREATE TABLE test (field1 VARCHAR(100))');
|
||||
}
|
||||
|
||||
public function testRowCountForEmptyTableReturnsZero()
|
||||
{
|
||||
$conn = new DefaultConnection($this->db);
|
||||
$this->assertEquals(0, $conn->getRowCount('test'));
|
||||
}
|
||||
|
||||
public function testRowCountForTableWithTwoRowsReturnsTwo()
|
||||
{
|
||||
$this->db->exec('INSERT INTO test (field1) VALUES (\'foobar\')');
|
||||
$this->db->exec('INSERT INTO test (field1) VALUES (\'foobarbaz\')');
|
||||
|
||||
$conn = new DefaultConnection($this->db);
|
||||
$this->assertEquals(2, $conn->getRowCount('test'));
|
||||
}
|
||||
}
|
||||
305
vendor/phpunit/dbunit/tests/DataSet/AbstractTableTest.php
vendored
Normal file
305
vendor/phpunit/dbunit/tests/DataSet/AbstractTableTest.php
vendored
Normal file
@@ -0,0 +1,305 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTable;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTableMetadata;
|
||||
use PHPUnit\DbUnit\DataSet\ITable;
|
||||
use PHPUnit\DbUnit\DataSet\ITableMetadata;
|
||||
use PHPUnit\DbUnit\DataSet\QueryTable;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class Extensions_Database_DataSet_AbstractTableTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var QueryTable
|
||||
*/
|
||||
protected $table;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$tableMetaData = new DefaultTableMetadata(
|
||||
'table', ['id', 'column1']
|
||||
);
|
||||
|
||||
$this->table = new DefaultTable($tableMetaData);
|
||||
|
||||
$this->table->addRow([
|
||||
'id' => 1,
|
||||
'column1' => 'randomValue'
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $row
|
||||
* @param bool $exists
|
||||
* @dataProvider providerTableContainsRow
|
||||
*/
|
||||
public function testTableContainsRow($row, $exists)
|
||||
{
|
||||
$result = $this->table->assertContainsRow($row);
|
||||
$this->assertEquals($exists, $result);
|
||||
}
|
||||
|
||||
public function providerTableContainsRow()
|
||||
{
|
||||
return [
|
||||
[['id' => 1, 'column1' => 'randomValue'], true],
|
||||
[['id' => 1, 'column1' => 'notExistingValue'], false]
|
||||
];
|
||||
}
|
||||
|
||||
public function testMatchesWithNonMatchingMetaData()
|
||||
{
|
||||
$tableMetaData = $this->createMock(ITableMetadata::class);
|
||||
$otherMetaData = $this->createMock(ITableMetadata::class);
|
||||
|
||||
$otherTable = $this->createMock(ITable::class);
|
||||
$otherTable->expects($this->once())
|
||||
->method('getTableMetaData')
|
||||
->will($this->returnValue($otherMetaData));
|
||||
|
||||
$tableMetaData->expects($this->once())
|
||||
->method('matches')
|
||||
->with($otherMetaData)
|
||||
->will($this->returnValue(false));
|
||||
|
||||
$table = new DefaultTable($tableMetaData);
|
||||
$this->assertFalse($table->matches($otherTable));
|
||||
}
|
||||
|
||||
public function testMatchesWithNonMatchingRowCount()
|
||||
{
|
||||
$tableMetaData = $this->createMock(ITableMetadata::class);
|
||||
$otherMetaData = $this->createMock(ITableMetadata::class);
|
||||
$otherTable = $this->createMock(ITable::class);
|
||||
|
||||
$table = $this->getMockBuilder(DefaultTable::class)
|
||||
->setConstructorArgs([$tableMetaData])
|
||||
->setMethods(['getRowCount'])
|
||||
->getMock();
|
||||
|
||||
$otherTable->expects($this->once())
|
||||
->method('getTableMetaData')
|
||||
->will($this->returnValue($otherMetaData));
|
||||
$otherTable->expects($this->once())
|
||||
->method('getRowCount')
|
||||
->will($this->returnValue(0));
|
||||
|
||||
$tableMetaData->expects($this->once())
|
||||
->method('matches')
|
||||
->with($otherMetaData)
|
||||
->will($this->returnValue(true));
|
||||
|
||||
$table->expects($this->once())
|
||||
->method('getRowCount')
|
||||
->will($this->returnValue(1));
|
||||
$this->assertFalse($table->matches($otherTable));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $tableColumnValues
|
||||
* @param array $otherColumnValues
|
||||
* @param bool $matches
|
||||
* @dataProvider providerMatchesWithColumnValueComparisons
|
||||
*/
|
||||
public function testMatchesWithColumnValueComparisons($tableColumnValues, $otherColumnValues, $matches)
|
||||
{
|
||||
$tableMetaData = $this->createMock(ITableMetadata::class);
|
||||
$otherMetaData = $this->createMock(ITableMetadata::class);
|
||||
$otherTable = $this->createMock(ITable::class);
|
||||
|
||||
$table = $this->getMockBuilder(DefaultTable::class)
|
||||
->setConstructorArgs([$tableMetaData])
|
||||
->setMethods(['getRowCount', 'getValue'])
|
||||
->getMock();
|
||||
|
||||
$otherTable->expects($this->once())
|
||||
->method('getTableMetaData')
|
||||
->will($this->returnValue($otherMetaData));
|
||||
$otherTable->expects($this->once())
|
||||
->method('getRowCount')
|
||||
->will($this->returnValue(count($otherColumnValues)));
|
||||
|
||||
$tableMetaData->expects($this->once())
|
||||
->method('getColumns')
|
||||
->will($this->returnValue(array_keys(reset($tableColumnValues))));
|
||||
$tableMetaData->expects($this->once())
|
||||
->method('matches')
|
||||
->with($otherMetaData)
|
||||
->will($this->returnValue(true));
|
||||
|
||||
$table->expects($this->any())
|
||||
->method('getRowCount')
|
||||
->will($this->returnValue(count($tableColumnValues)));
|
||||
|
||||
$tableMap = [];
|
||||
$otherMap = [];
|
||||
foreach ($tableColumnValues as $rowIndex => $rowData) {
|
||||
foreach ($rowData as $columnName => $columnValue) {
|
||||
$tableMap[] = [$rowIndex, $columnName, $columnValue];
|
||||
$otherMap[] = [$rowIndex, $columnName, $otherColumnValues[$rowIndex][$columnName]];
|
||||
}
|
||||
}
|
||||
$table->expects($this->any())
|
||||
->method('getValue')
|
||||
->will($this->returnValueMap($tableMap));
|
||||
$otherTable->expects($this->any())
|
||||
->method('getValue')
|
||||
->will($this->returnValueMap($otherMap));
|
||||
|
||||
$this->assertSame($matches, $table->matches($otherTable));
|
||||
}
|
||||
|
||||
public function providerMatchesWithColumnValueComparisons()
|
||||
{
|
||||
return [
|
||||
|
||||
// One row, one column, matches
|
||||
[
|
||||
[
|
||||
['id' => 1],
|
||||
],
|
||||
[
|
||||
['id' => 1],
|
||||
],
|
||||
true,
|
||||
],
|
||||
|
||||
// One row, one column, does not match
|
||||
[
|
||||
[
|
||||
['id' => 1],
|
||||
],
|
||||
[
|
||||
['id' => 2],
|
||||
],
|
||||
false,
|
||||
],
|
||||
|
||||
// Multiple rows, one column, matches
|
||||
[
|
||||
[
|
||||
['id' => 1],
|
||||
['id' => 2],
|
||||
],
|
||||
[
|
||||
['id' => 1],
|
||||
['id' => 2],
|
||||
],
|
||||
true,
|
||||
],
|
||||
|
||||
// Multiple rows, one column, do not match
|
||||
[
|
||||
[
|
||||
['id' => 1],
|
||||
['id' => 2],
|
||||
],
|
||||
[
|
||||
['id' => 1],
|
||||
['id' => 3],
|
||||
],
|
||||
false,
|
||||
],
|
||||
|
||||
// Multiple rows, multiple columns, matches
|
||||
[
|
||||
[
|
||||
['id' => 1, 'name' => 'foo'],
|
||||
['id' => 2, 'name' => 'bar'],
|
||||
],
|
||||
[
|
||||
['id' => 1, 'name' => 'foo'],
|
||||
['id' => 2, 'name' => 'bar'],
|
||||
],
|
||||
true,
|
||||
],
|
||||
|
||||
// Multiple rows, multiple columns, do not match
|
||||
[
|
||||
[
|
||||
['id' => 1, 'name' => 'foo'],
|
||||
['id' => 2, 'name' => 'bar'],
|
||||
],
|
||||
[
|
||||
['id' => 1, 'name' => 'foo'],
|
||||
['id' => 2, 'name' => 'baz'],
|
||||
],
|
||||
false,
|
||||
],
|
||||
|
||||
// Int and int as string must match
|
||||
[
|
||||
[
|
||||
['id' => 42],
|
||||
],
|
||||
[
|
||||
['id' => '42'],
|
||||
],
|
||||
true,
|
||||
],
|
||||
|
||||
// Float and float as string must match
|
||||
[
|
||||
[
|
||||
['id' => 15.3],
|
||||
],
|
||||
[
|
||||
['id' => '15.3'],
|
||||
],
|
||||
true,
|
||||
],
|
||||
|
||||
// Int and float must match
|
||||
[
|
||||
[
|
||||
['id' => 18.00],
|
||||
],
|
||||
[
|
||||
['id' => 18],
|
||||
],
|
||||
true,
|
||||
],
|
||||
|
||||
// 0 and empty string must not match
|
||||
[
|
||||
[
|
||||
['id' => 0],
|
||||
],
|
||||
[
|
||||
['id' => ''],
|
||||
],
|
||||
false,
|
||||
],
|
||||
|
||||
// 0 and null must not match
|
||||
[
|
||||
[
|
||||
['id' => 0],
|
||||
],
|
||||
[
|
||||
['id' => null],
|
||||
],
|
||||
false,
|
||||
],
|
||||
|
||||
// empty string and null must not match
|
||||
[
|
||||
[
|
||||
['id' => ''],
|
||||
],
|
||||
[
|
||||
['id' => null],
|
||||
],
|
||||
false,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
188
vendor/phpunit/dbunit/tests/DataSet/CompositeDataSetTest.php
vendored
Normal file
188
vendor/phpunit/dbunit/tests/DataSet/CompositeDataSetTest.php
vendored
Normal file
@@ -0,0 +1,188 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use PHPUnit\DbUnit\DataSet\CompositeDataSet;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultDataSet;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTable;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTableMetadata;
|
||||
use PHPUnit\DbUnit\TestCase;
|
||||
|
||||
class Extensions_Database_DataSet_CompositeDataSetTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected $expectedDataSet1;
|
||||
protected $expectedDataSet2;
|
||||
protected $expectedDataSet3;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$table1MetaData = new DefaultTableMetadata(
|
||||
'table1', ['table1_id', 'column1', 'column2', 'column3', 'column4']
|
||||
);
|
||||
$table2MetaData = new DefaultTableMetadata(
|
||||
'table2', ['table2_id', 'column5', 'column6', 'column7', 'column8']
|
||||
);
|
||||
|
||||
$table3MetaData = new DefaultTableMetadata(
|
||||
'table3', ['table3_id', 'column9', 'column10', 'column11', 'column12']
|
||||
);
|
||||
|
||||
$table1 = new DefaultTable($table1MetaData);
|
||||
$table2 = new DefaultTable($table2MetaData);
|
||||
$table3 = new DefaultTable($table3MetaData);
|
||||
|
||||
$table1->addRow([
|
||||
'table1_id' => 1,
|
||||
'column1' => 'tgfahgasdf',
|
||||
'column2' => 200,
|
||||
'column3' => 34.64,
|
||||
'column4' => 'yghkf;a hahfg8ja h;'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 2,
|
||||
'column1' => 'hk;afg',
|
||||
'column2' => 654,
|
||||
'column3' => 46.54,
|
||||
'column4' => '24rwehhads'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 3,
|
||||
'column1' => 'ha;gyt',
|
||||
'column2' => 462,
|
||||
'column3' => 1654.4,
|
||||
'column4' => 'asfgklg'
|
||||
]);
|
||||
|
||||
$table2->addRow([
|
||||
'table2_id' => 1,
|
||||
'column5' => 'fhah',
|
||||
'column6' => 456,
|
||||
'column7' => 46.5,
|
||||
'column8' => 'fsdb, ghfdas'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 2,
|
||||
'column5' => 'asdhfoih',
|
||||
'column6' => 654,
|
||||
'column7' => 'blah',
|
||||
'column8' => '43asd "fhgj" sfadh'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 3,
|
||||
'column5' => 'ajsdlkfguitah',
|
||||
'column6' => 654,
|
||||
'column7' => 'blah',
|
||||
'column8' => 'thesethasdl
|
||||
asdflkjsadf asdfsadfhl "adsf, halsdf" sadfhlasdf'
|
||||
]);
|
||||
|
||||
$table3->addRow([
|
||||
'table3_id' => 1,
|
||||
'column9' => 'sfgsda',
|
||||
'column10' => 16,
|
||||
'column11' => 45.57,
|
||||
'column12' => 'sdfh .ds,ajfas asdf h'
|
||||
]);
|
||||
$table3->addRow([
|
||||
'table3_id' => 2,
|
||||
'column9' => 'afdstgb',
|
||||
'column10' => 41,
|
||||
'column11' => 46.645,
|
||||
'column12' => '87yhasdf sadf yah;/a '
|
||||
]);
|
||||
$table3->addRow([
|
||||
'table3_id' => 3,
|
||||
'column9' => 'gldsf',
|
||||
'column10' => 46,
|
||||
'column11' => 123.456,
|
||||
'column12' => '0y8hosnd a/df7y olgbjs da'
|
||||
]);
|
||||
|
||||
$this->expectedDataSet1 = new DefaultDataSet([$table1, $table2]);
|
||||
$this->expectedDataSet2 = new DefaultDataSet([$table3]);
|
||||
$this->expectedDataSet3 = new DefaultDataSet([$table1, $table2, $table3]);
|
||||
}
|
||||
|
||||
public function testCompositeDataSet()
|
||||
{
|
||||
$actual = new CompositeDataSet([$this->expectedDataSet1, $this->expectedDataSet2]);
|
||||
|
||||
TestCase::assertDataSetsEqual($this->expectedDataSet3, $actual);
|
||||
}
|
||||
|
||||
public function testCompatibleTablesInDifferentDataSetsNonDuplicateRows()
|
||||
{
|
||||
$compatibleTable = new DefaultTable(
|
||||
$this->expectedDataSet3->getTable('table3')->getTableMetaData()
|
||||
);
|
||||
|
||||
$compatibleTable->addRow([
|
||||
'table3_id' => 4,
|
||||
'column9' => 'asdasd',
|
||||
'column10' => 17,
|
||||
'column11' => 42.57,
|
||||
'column12' => 'askldja'
|
||||
]);
|
||||
|
||||
$compositeDataSet = new CompositeDataSet([
|
||||
new DefaultDataSet([$compatibleTable]),
|
||||
$this->expectedDataSet2
|
||||
]);
|
||||
|
||||
$this->assertEquals(4, $compositeDataSet->getTable('table3')->getRowCount());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException InvalidArgumentException
|
||||
* @expectedExceptionMessage There is already a table named table3 with different table definition
|
||||
*/
|
||||
public function testExceptionOnIncompatibleTablesSameTableNames()
|
||||
{
|
||||
$inCompatibleTableMetaData = new DefaultTableMetadata(
|
||||
'table3', ['table3_id', 'column13', 'column14', 'column15', 'column16']
|
||||
);
|
||||
|
||||
$inCompatibleTable = new DefaultTable($inCompatibleTableMetaData);
|
||||
$inCompatibleTable->addRow([
|
||||
'column13' => 'asdasda asdasd',
|
||||
'column14' => 'aiafsjas asd',
|
||||
'column15' => 'asdasdasd',
|
||||
'column16' => 2141
|
||||
]);
|
||||
|
||||
$compositeDataSet = new CompositeDataSet([
|
||||
$this->expectedDataSet2,
|
||||
new DefaultDataSet([$inCompatibleTable])
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException InvalidArgumentException
|
||||
* @expectedExceptionMessage There is already a table named table3 with different table definition
|
||||
*/
|
||||
public function testExceptionOnIncompatibleTablesSameTableNames2()
|
||||
{
|
||||
$inCompatibleTableMetaData = new DefaultTableMetadata(
|
||||
'table3', ['table3_id', 'column13', 'column14', 'column15', 'column16']
|
||||
);
|
||||
|
||||
$inCompatibleTable = new DefaultTable($inCompatibleTableMetaData);
|
||||
$inCompatibleTable->addRow([
|
||||
'column13' => 'asdasda asdasd',
|
||||
'column14' => 'aiafsjas asd',
|
||||
'column15' => 'asdasdasd',
|
||||
'column16' => 2141
|
||||
]);
|
||||
|
||||
$compositeDataSet = new CompositeDataSet([
|
||||
new DefaultDataSet([$inCompatibleTable]),
|
||||
$this->expectedDataSet2
|
||||
]);
|
||||
}
|
||||
}
|
||||
86
vendor/phpunit/dbunit/tests/DataSet/CsvDataSetTest.php
vendored
Normal file
86
vendor/phpunit/dbunit/tests/DataSet/CsvDataSetTest.php
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use PHPUnit\DbUnit\DataSet\CsvDataSet;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultDataSet;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTable;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTableMetadata;
|
||||
use PHPUnit\DbUnit\TestCase;
|
||||
|
||||
class Extensions_Database_DataSet_CsvDataSetTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
protected $expectedDataSet;
|
||||
|
||||
public function testCSVDataSet()
|
||||
{
|
||||
$table1MetaData = new DefaultTableMetadata(
|
||||
'table1', ['table1_id', 'column1', 'column2', 'column3', 'column4']
|
||||
);
|
||||
$table2MetaData = new DefaultTableMetadata(
|
||||
'table2', ['table2_id', 'column5', 'column6', 'column7', 'column8']
|
||||
);
|
||||
|
||||
$table1 = new DefaultTable($table1MetaData);
|
||||
$table2 = new DefaultTable($table2MetaData);
|
||||
|
||||
$table1->addRow([
|
||||
'table1_id' => 1,
|
||||
'column1' => 'tgfahgasdf',
|
||||
'column2' => 200,
|
||||
'column3' => 34.64,
|
||||
'column4' => 'yghkf;a hahfg8ja h;'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 2,
|
||||
'column1' => 'hk;afg',
|
||||
'column2' => 654,
|
||||
'column3' => 46.54,
|
||||
'column4' => '24rwehhads'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 3,
|
||||
'column1' => 'ha;gyt',
|
||||
'column2' => 462,
|
||||
'column3' => 1654.4,
|
||||
'column4' => 'asfgklg'
|
||||
]);
|
||||
|
||||
$table2->addRow([
|
||||
'table2_id' => 1,
|
||||
'column5' => 'fhah',
|
||||
'column6' => 456,
|
||||
'column7' => 46.5,
|
||||
'column8' => 'fsdb, ghfdas'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 2,
|
||||
'column5' => 'asdhfoih',
|
||||
'column6' => 654,
|
||||
'column7' => 'blah',
|
||||
'column8' => '43asd "fhgj" sfadh'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 3,
|
||||
'column5' => 'ajsdlkfguitah',
|
||||
'column6' => 654,
|
||||
'column7' => 'blah',
|
||||
'column8' => 'thesethasdl
|
||||
asdflkjsadf asdfsadfhl "adsf, halsdf" sadfhlasdf'
|
||||
]);
|
||||
|
||||
$expectedDataSet = new DefaultDataSet([$table1, $table2]);
|
||||
|
||||
$csvDataSet = new CsvDataSet();
|
||||
$csvDataSet->addTable('table1', dirname(__FILE__) . '/../_files/CsvDataSets/table1.csv');
|
||||
$csvDataSet->addTable('table2', dirname(__FILE__) . '/../_files/CsvDataSets/table2.csv');
|
||||
|
||||
TestCase::assertDataSetsEqual($expectedDataSet, $csvDataSet);
|
||||
}
|
||||
}
|
||||
90
vendor/phpunit/dbunit/tests/DataSet/FilterTest.php
vendored
Normal file
90
vendor/phpunit/dbunit/tests/DataSet/FilterTest.php
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use PHPUnit\DbUnit\Constraint\DataSetIsEqual;
|
||||
use PHPUnit\DbUnit\DataSet\Filter;
|
||||
use PHPUnit\DbUnit\DataSet\FlatXmlDataSet;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class Extensions_Database_DataSet_FilterTest extends TestCase
|
||||
{
|
||||
protected $expectedDataSet;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->expectedDataSet = new FlatXmlDataSet(
|
||||
dirname(__FILE__) . '/../_files/XmlDataSets/FilteredTestFixture.xml'
|
||||
);
|
||||
}
|
||||
|
||||
public function testDeprecatedFilteredDataSetConstructor()
|
||||
{
|
||||
$constraint = new DataSetIsEqual($this->expectedDataSet);
|
||||
$dataSet = new FlatXmlDataSet(
|
||||
dirname(__FILE__) . '/../_files/XmlDataSets/FilteredTestComparison.xml'
|
||||
);
|
||||
|
||||
$filteredDataSet = new Filter($dataSet, [
|
||||
'table1' => ['table1_id'],
|
||||
'table2' => '*',
|
||||
'table3' => 'table3_id'
|
||||
]);
|
||||
|
||||
self::assertThat($filteredDataSet, $constraint);
|
||||
}
|
||||
|
||||
public function testExcludeFilteredDataSet()
|
||||
{
|
||||
$constraint = new DataSetIsEqual($this->expectedDataSet);
|
||||
$dataSet = new FlatXmlDataSet(
|
||||
dirname(__FILE__) . '/../_files/XmlDataSets/FilteredTestComparison.xml'
|
||||
);
|
||||
|
||||
$filteredDataSet = new Filter($dataSet);
|
||||
|
||||
$filteredDataSet->addExcludeTables(['table2']);
|
||||
$filteredDataSet->setExcludeColumnsForTable('table1', ['table1_id']);
|
||||
$filteredDataSet->setExcludeColumnsForTable('table3', ['table3_id']);
|
||||
|
||||
self::assertThat($filteredDataSet, $constraint);
|
||||
}
|
||||
|
||||
public function testIncludeFilteredDataSet()
|
||||
{
|
||||
$constraint = new DataSetIsEqual($this->expectedDataSet);
|
||||
$dataSet = new FlatXmlDataSet(
|
||||
dirname(__FILE__) . '/../_files/XmlDataSets/FilteredTestComparison.xml'
|
||||
);
|
||||
|
||||
$filteredDataSet = new Filter($dataSet);
|
||||
|
||||
$filteredDataSet->addIncludeTables(['table1', 'table3']);
|
||||
$filteredDataSet->setIncludeColumnsForTable('table1', ['column1', 'column2', 'column3', 'column4']);
|
||||
$filteredDataSet->setIncludeColumnsForTable('table3', ['column9', 'column10', 'column11', 'column12']);
|
||||
|
||||
self::assertThat($filteredDataSet, $constraint);
|
||||
}
|
||||
|
||||
public function testIncludeExcludeMixedDataSet()
|
||||
{
|
||||
$constraint = new DataSetIsEqual($this->expectedDataSet);
|
||||
$dataSet = new FlatXmlDataSet(
|
||||
dirname(__FILE__) . '/../_files/XmlDataSets/FilteredTestComparison.xml'
|
||||
);
|
||||
|
||||
$filteredDataSet = new Filter($dataSet);
|
||||
|
||||
$filteredDataSet->addIncludeTables(['table1', 'table3']);
|
||||
$filteredDataSet->setExcludeColumnsForTable('table1', ['table1_id']);
|
||||
$filteredDataSet->setIncludeColumnsForTable('table3', ['column9', 'column10', 'column11', 'column12']);
|
||||
|
||||
self::assertThat($filteredDataSet, $constraint);
|
||||
}
|
||||
}
|
||||
98
vendor/phpunit/dbunit/tests/DataSet/QueryDataSetTest.php
vendored
Normal file
98
vendor/phpunit/dbunit/tests/DataSet/QueryDataSetTest.php
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use PHPUnit\DbUnit\Database\DefaultConnection;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTable;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTableMetadata;
|
||||
use PHPUnit\DbUnit\DataSet\ITable;
|
||||
use PHPUnit\DbUnit\DataSet\QueryDataSet;
|
||||
use PHPUnit\DbUnit\TestCase;
|
||||
|
||||
class Extensions_Database_DataSet_QueryDataSetTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var QueryDataSet
|
||||
*/
|
||||
protected $dataSet;
|
||||
|
||||
protected $pdo;
|
||||
|
||||
/**
|
||||
* @return DefaultConnection
|
||||
*/
|
||||
protected function getConnection()
|
||||
{
|
||||
return $this->createDefaultDBConnection($this->pdo, 'test');
|
||||
}
|
||||
|
||||
protected function getDataSet()
|
||||
{
|
||||
return $this->createFlatXMLDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/QueryDataSetTest.xml');
|
||||
}
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->pdo = DBUnitTestUtility::getSQLiteMemoryDB();
|
||||
parent::setUp();
|
||||
$this->dataSet = new QueryDataSet($this->getConnection());
|
||||
$this->dataSet->addTable('table1');
|
||||
$this->dataSet->addTable('query1', '
|
||||
SELECT
|
||||
t1.column1 tc1, t2.column5 tc2
|
||||
FROM
|
||||
table1 t1
|
||||
JOIN table2 t2 ON t1.table1_id = t2.table2_id
|
||||
');
|
||||
}
|
||||
|
||||
public function testGetTable()
|
||||
{
|
||||
$expectedTable1 = $this->getConnection()->createDataSet(['table1'])->getTable('table1');
|
||||
|
||||
$expectedTable2 = new DefaultTable(
|
||||
new DefaultTableMetadata('query1', ['tc1', 'tc2'])
|
||||
);
|
||||
|
||||
$expectedTable2->addRow(['tc1' => 'bar', 'tc2' => 'blah']);
|
||||
|
||||
$this->assertTablesEqual($expectedTable1, $this->dataSet->getTable('table1'));
|
||||
$this->assertTablesEqual($expectedTable2, $this->dataSet->getTable('query1'));
|
||||
}
|
||||
|
||||
public function testGetTableNames()
|
||||
{
|
||||
$this->assertEquals(['table1', 'query1'], $this->dataSet->getTableNames());
|
||||
}
|
||||
|
||||
public function testCreateIterator()
|
||||
{
|
||||
$expectedTable1 = $this->getConnection()->createDataSet(['table1'])->getTable('table1');
|
||||
|
||||
$expectedTable2 = new DefaultTable(
|
||||
new DefaultTableMetadata('query1', ['tc1', 'tc2'])
|
||||
);
|
||||
|
||||
$expectedTable2->addRow(['tc1' => 'bar', 'tc2' => 'blah']);
|
||||
|
||||
foreach ($this->dataSet as $i => $table) {
|
||||
/* @var $table ITable */
|
||||
switch ($table->getTableMetaData()->getTableName()) {
|
||||
case 'table1':
|
||||
$this->assertTablesEqual($expectedTable1, $table);
|
||||
break;
|
||||
case 'query1':
|
||||
$this->assertTablesEqual($expectedTable2, $table);
|
||||
break;
|
||||
default:
|
||||
$this->fail('Proper keys not present from the iterator');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
103
vendor/phpunit/dbunit/tests/DataSet/QueryTableTest.php
vendored
Normal file
103
vendor/phpunit/dbunit/tests/DataSet/QueryTableTest.php
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use PHPUnit\DbUnit\Database\DefaultConnection;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTable;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTableMetadata;
|
||||
use PHPUnit\DbUnit\DataSet\QueryTable;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class Extensions_Database_DataSet_QueryTableTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var QueryTable
|
||||
*/
|
||||
protected $table;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$query = "
|
||||
SELECT
|
||||
'value1' as col1,
|
||||
'value2' as col2,
|
||||
'value3' as col3
|
||||
UNION SELECT
|
||||
'value4' as col1,
|
||||
'value5' as col2,
|
||||
'value6' as col3
|
||||
";
|
||||
$this->table = new QueryTable(
|
||||
'table1',
|
||||
$query,
|
||||
new DefaultConnection(new PDO('sqlite::memory:'), 'test')
|
||||
);
|
||||
}
|
||||
|
||||
public static function providerTestGetValue()
|
||||
{
|
||||
return [
|
||||
[0, 'col1', 'value1'],
|
||||
[0, 'col2', 'value2'],
|
||||
[0, 'col3', 'value3'],
|
||||
[1, 'col1', 'value4'],
|
||||
[1, 'col2', 'value5'],
|
||||
[1, 'col3', 'value6'],
|
||||
];
|
||||
}
|
||||
|
||||
public function testGetTableMetaData()
|
||||
{
|
||||
$metaData = new DefaultTableMetadata('table1', ['col1', 'col2', 'col3']);
|
||||
|
||||
$this->assertEquals($metaData, $this->table->getTableMetaData());
|
||||
}
|
||||
|
||||
public function testGetRowCount()
|
||||
{
|
||||
$this->assertEquals(2, $this->table->getRowCount());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerTestGetValue
|
||||
*/
|
||||
public function testGetValue($row, $column, $value)
|
||||
{
|
||||
$this->assertEquals($value, $this->table->getValue($row, $column));
|
||||
}
|
||||
|
||||
public function testGetRow()
|
||||
{
|
||||
$this->assertEquals(['col1' => 'value1', 'col2' => 'value2', 'col3' => 'value3'], $this->table->getRow(0));
|
||||
}
|
||||
|
||||
public function testAssertEquals()
|
||||
{
|
||||
$expected_table = new DefaultTable(new DefaultTableMetadata('table1', ['col1', 'col2', 'col3']));
|
||||
$expected_table->addRow(['col1' => 'value1', 'col2' => 'value2', 'col3' => 'value3']);
|
||||
$expected_table->addRow(['col1' => 'value4', 'col2' => 'value5', 'col3' => 'value6']);
|
||||
$this->assertTrue($this->table->matches($expected_table));
|
||||
}
|
||||
|
||||
public function testAssertEqualsFails()
|
||||
{
|
||||
$expected_table = new DefaultTable(new DefaultTableMetadata('table1', ['col1', 'col2', 'col3']));
|
||||
$expected_table->addRow(['col1' => 'value1', 'col2' => 'value2', 'col3' => 'value3']);
|
||||
$expected_table->addRow(['col1' => 'value4', 'col2' => 'value5', 'col3' => 'value6']);
|
||||
$expected_table->addRow(['col1' => 'value7', 'col2' => 'value8', 'col3' => 'value9']);
|
||||
$this->assertFalse($this->table->matches($expected_table));
|
||||
}
|
||||
|
||||
public function testAssertRowContains()
|
||||
{
|
||||
$this->assertTrue($this->table->assertContainsRow(
|
||||
['col1' => 'value1', 'col2' => 'value2', 'col3' => 'value3']
|
||||
));
|
||||
}
|
||||
}
|
||||
282
vendor/phpunit/dbunit/tests/DataSet/ReplacementDataSetTest.php
vendored
Normal file
282
vendor/phpunit/dbunit/tests/DataSet/ReplacementDataSetTest.php
vendored
Normal file
@@ -0,0 +1,282 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use PHPUnit\DbUnit\DataSet\DefaultDataSet;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTable;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTableMetadata;
|
||||
use PHPUnit\DbUnit\DataSet\ReplacementDataSet;
|
||||
use PHPUnit\DbUnit\TestCase;
|
||||
|
||||
class Extensions_Database_DataSet_ReplacementDataSetTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var DefaultDataSet
|
||||
*/
|
||||
protected $startingDataSet;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$table1MetaData = new DefaultTableMetadata(
|
||||
'table1', ['table1_id', 'column1', 'column2', 'column3', 'column4']
|
||||
);
|
||||
$table2MetaData = new DefaultTableMetadata(
|
||||
'table2', ['table2_id', 'column5', 'column6', 'column7', 'column8']
|
||||
);
|
||||
|
||||
$table1 = new DefaultTable($table1MetaData);
|
||||
$table2 = new DefaultTable($table2MetaData);
|
||||
|
||||
$table1->addRow([
|
||||
'table1_id' => 1,
|
||||
'column1' => 'My name is %%%name%%%',
|
||||
'column2' => 200,
|
||||
'column3' => 34.64,
|
||||
'column4' => 'yghkf;a hahfg8ja h;'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 2,
|
||||
'column1' => 'hk;afg',
|
||||
'column2' => 654,
|
||||
'column3' => 46.54,
|
||||
'column4' => '24rwehhads'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 3,
|
||||
'column1' => 'ha;gyt',
|
||||
'column2' => 462,
|
||||
'column3' => 1654.4,
|
||||
'column4' => '[NULL]'
|
||||
]);
|
||||
|
||||
$table2->addRow([
|
||||
'table2_id' => 1,
|
||||
'column5' => 'fhah',
|
||||
'column6' => 456,
|
||||
'column7' => 46.5,
|
||||
'column8' => 'My name is %%%name%%%'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 2,
|
||||
'column5' => 'asdhfoih',
|
||||
'column6' => 654,
|
||||
'column7' => '[NULL]',
|
||||
'column8' => '43asdfhgj'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 3,
|
||||
'column5' => 'ajsdlkfguitah',
|
||||
'column6' => 654,
|
||||
'column7' => '[NULL]',
|
||||
'column8' => '[NULL] not really'
|
||||
]);
|
||||
|
||||
$this->startingDataSet = new DefaultDataSet([$table1, $table2]);
|
||||
}
|
||||
|
||||
public function testNoReplacement()
|
||||
{
|
||||
TestCase::assertDataSetsEqual(
|
||||
$this->startingDataSet,
|
||||
new ReplacementDataSet($this->startingDataSet)
|
||||
);
|
||||
}
|
||||
|
||||
public function testFullReplacement()
|
||||
{
|
||||
$table1MetaData = new DefaultTableMetadata(
|
||||
'table1', ['table1_id', 'column1', 'column2', 'column3', 'column4']
|
||||
);
|
||||
$table2MetaData = new DefaultTableMetadata(
|
||||
'table2', ['table2_id', 'column5', 'column6', 'column7', 'column8']
|
||||
);
|
||||
|
||||
$table1 = new DefaultTable($table1MetaData);
|
||||
$table2 = new DefaultTable($table2MetaData);
|
||||
|
||||
$table1->addRow([
|
||||
'table1_id' => 1,
|
||||
'column1' => 'My name is %%%name%%%',
|
||||
'column2' => 200,
|
||||
'column3' => 34.64,
|
||||
'column4' => 'yghkf;a hahfg8ja h;'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 2,
|
||||
'column1' => 'hk;afg',
|
||||
'column2' => 654,
|
||||
'column3' => 46.54,
|
||||
'column4' => '24rwehhads'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 3,
|
||||
'column1' => 'ha;gyt',
|
||||
'column2' => 462,
|
||||
'column3' => 1654.4,
|
||||
'column4' => null
|
||||
]);
|
||||
|
||||
$table2->addRow([
|
||||
'table2_id' => 1,
|
||||
'column5' => 'fhah',
|
||||
'column6' => 456,
|
||||
'column7' => 46.5,
|
||||
'column8' => 'My name is %%%name%%%'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 2,
|
||||
'column5' => 'asdhfoih',
|
||||
'column6' => 654,
|
||||
'column7' => null,
|
||||
'column8' => '43asdfhgj'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 3,
|
||||
'column5' => 'ajsdlkfguitah',
|
||||
'column6' => 654,
|
||||
'column7' => null,
|
||||
'column8' => '[NULL] not really'
|
||||
]);
|
||||
|
||||
$expected = new DefaultDataSet([$table1, $table2]);
|
||||
$actual = new ReplacementDataSet($this->startingDataSet);
|
||||
$actual->addFullReplacement('[NULL]', null);
|
||||
|
||||
TestCase::assertDataSetsEqual($expected, $actual);
|
||||
}
|
||||
|
||||
public function testSubStrReplacement()
|
||||
{
|
||||
$table1MetaData = new DefaultTableMetadata(
|
||||
'table1', ['table1_id', 'column1', 'column2', 'column3', 'column4']
|
||||
);
|
||||
$table2MetaData = new DefaultTableMetadata(
|
||||
'table2', ['table2_id', 'column5', 'column6', 'column7', 'column8']
|
||||
);
|
||||
|
||||
$table1 = new DefaultTable($table1MetaData);
|
||||
$table2 = new DefaultTable($table2MetaData);
|
||||
|
||||
$table1->addRow([
|
||||
'table1_id' => 1,
|
||||
'column1' => 'My name is Mike Lively',
|
||||
'column2' => 200,
|
||||
'column3' => 34.64,
|
||||
'column4' => 'yghkf;a hahfg8ja h;'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 2,
|
||||
'column1' => 'hk;afg',
|
||||
'column2' => 654,
|
||||
'column3' => 46.54,
|
||||
'column4' => '24rwehhads'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 3,
|
||||
'column1' => 'ha;gyt',
|
||||
'column2' => 462,
|
||||
'column3' => 1654.4,
|
||||
'column4' => '[NULL]'
|
||||
]);
|
||||
|
||||
$table2->addRow([
|
||||
'table2_id' => 1,
|
||||
'column5' => 'fhah',
|
||||
'column6' => 456,
|
||||
'column7' => 46.5,
|
||||
'column8' => 'My name is Mike Lively'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 2,
|
||||
'column5' => 'asdhfoih',
|
||||
'column6' => 654,
|
||||
'column7' => '[NULL]',
|
||||
'column8' => '43asdfhgj'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 3,
|
||||
'column5' => 'ajsdlkfguitah',
|
||||
'column6' => 654,
|
||||
'column7' => '[NULL]',
|
||||
'column8' => '[NULL] not really'
|
||||
]);
|
||||
|
||||
$expected = new DefaultDataSet([$table1, $table2]);
|
||||
$actual = new ReplacementDataSet($this->startingDataSet);
|
||||
$actual->addSubStrReplacement('%%%name%%%', 'Mike Lively');
|
||||
|
||||
TestCase::assertDataSetsEqual($expected, $actual);
|
||||
}
|
||||
|
||||
public function testConstructorReplacements()
|
||||
{
|
||||
$table1MetaData = new DefaultTableMetadata(
|
||||
'table1', ['table1_id', 'column1', 'column2', 'column3', 'column4']
|
||||
);
|
||||
$table2MetaData = new DefaultTableMetadata(
|
||||
'table2', ['table2_id', 'column5', 'column6', 'column7', 'column8']
|
||||
);
|
||||
|
||||
$table1 = new DefaultTable($table1MetaData);
|
||||
$table2 = new DefaultTable($table2MetaData);
|
||||
|
||||
$table1->addRow([
|
||||
'table1_id' => 1,
|
||||
'column1' => 'My name is Mike Lively',
|
||||
'column2' => 200,
|
||||
'column3' => 34.64,
|
||||
'column4' => 'yghkf;a hahfg8ja h;'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 2,
|
||||
'column1' => 'hk;afg',
|
||||
'column2' => 654,
|
||||
'column3' => 46.54,
|
||||
'column4' => '24rwehhads'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 3,
|
||||
'column1' => 'ha;gyt',
|
||||
'column2' => 462,
|
||||
'column3' => 1654.4,
|
||||
'column4' => null
|
||||
]);
|
||||
|
||||
$table2->addRow([
|
||||
'table2_id' => 1,
|
||||
'column5' => 'fhah',
|
||||
'column6' => 456,
|
||||
'column7' => 46.5,
|
||||
'column8' => 'My name is Mike Lively'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 2,
|
||||
'column5' => 'asdhfoih',
|
||||
'column6' => 654,
|
||||
'column7' => null,
|
||||
'column8' => '43asdfhgj'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 3,
|
||||
'column5' => 'ajsdlkfguitah',
|
||||
'column6' => 654,
|
||||
'column7' => null,
|
||||
'column8' => '[NULL] not really'
|
||||
]);
|
||||
|
||||
$expected = new DefaultDataSet([$table1, $table2]);
|
||||
$actual = new ReplacementDataSet(
|
||||
$this->startingDataSet,
|
||||
['[NULL]' => null],
|
||||
['%%%name%%%' => 'Mike Lively']
|
||||
);
|
||||
|
||||
TestCase::assertDataSetsEqual($expected, $actual);
|
||||
}
|
||||
}
|
||||
482
vendor/phpunit/dbunit/tests/DataSet/ReplacementTableTest.php
vendored
Normal file
482
vendor/phpunit/dbunit/tests/DataSet/ReplacementTableTest.php
vendored
Normal file
@@ -0,0 +1,482 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTable;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTableMetadata;
|
||||
use PHPUnit\DbUnit\DataSet\ITable;
|
||||
use PHPUnit\DbUnit\DataSet\ITableMetadata;
|
||||
use PHPUnit\DbUnit\DataSet\ReplacementTable;
|
||||
use PHPUnit\DbUnit\TestCase;
|
||||
|
||||
class Extensions_Database_DataSet_ReplacementTableTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
/**
|
||||
* @var DefaultTable
|
||||
*/
|
||||
protected $startingTable;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$tableMetaData = new DefaultTableMetadata(
|
||||
'table1', ['table1_id', 'column1', 'column2', 'column3', 'column4']
|
||||
);
|
||||
|
||||
$table = new DefaultTable($tableMetaData);
|
||||
|
||||
$table->addRow([
|
||||
'table1_id' => 1,
|
||||
'column1' => 'My name is %%%name%%%',
|
||||
'column2' => 200,
|
||||
'column3' => 34.64,
|
||||
'column4' => 'yghkf;a hahfg8ja h;'
|
||||
]);
|
||||
$table->addRow([
|
||||
'table1_id' => 2,
|
||||
'column1' => 'hk;afg',
|
||||
'column2' => 654,
|
||||
'column3' => 46.54,
|
||||
'column4' => '24rwehhads'
|
||||
]);
|
||||
$table->addRow([
|
||||
'table1_id' => 3,
|
||||
'column1' => 'ha;gyt',
|
||||
'column2' => 462,
|
||||
'column3' => '[NULL] not really',
|
||||
'column4' => '[NULL]'
|
||||
]);
|
||||
|
||||
$this->startingTable = $table;
|
||||
}
|
||||
|
||||
public function testNoReplacement()
|
||||
{
|
||||
TestCase::assertTablesEqual(
|
||||
$this->startingTable,
|
||||
new ReplacementTable($this->startingTable)
|
||||
);
|
||||
}
|
||||
|
||||
public function testFullReplacement()
|
||||
{
|
||||
$tableMetaData = new DefaultTableMetadata(
|
||||
'table1', ['table1_id', 'column1', 'column2', 'column3', 'column4']
|
||||
);
|
||||
|
||||
$table = new DefaultTable($tableMetaData);
|
||||
|
||||
$table->addRow([
|
||||
'table1_id' => 1,
|
||||
'column1' => 'My name is %%%name%%%',
|
||||
'column2' => 200,
|
||||
'column3' => 34.64,
|
||||
'column4' => 'yghkf;a hahfg8ja h;'
|
||||
]);
|
||||
$table->addRow([
|
||||
'table1_id' => 2,
|
||||
'column1' => 'hk;afg',
|
||||
'column2' => 654,
|
||||
'column3' => 46.54,
|
||||
'column4' => '24rwehhads'
|
||||
]);
|
||||
$table->addRow([
|
||||
'table1_id' => 3,
|
||||
'column1' => 'ha;gyt',
|
||||
'column2' => 462,
|
||||
'column3' => '[NULL] not really',
|
||||
'column4' => null
|
||||
]);
|
||||
|
||||
$actual = new ReplacementTable($this->startingTable);
|
||||
$actual->addFullReplacement('[NULL]', null);
|
||||
|
||||
TestCase::assertTablesEqual($table, $actual);
|
||||
}
|
||||
|
||||
public function testSubStrReplacement()
|
||||
{
|
||||
$tableMetaData = new DefaultTableMetadata(
|
||||
'table1', ['table1_id', 'column1', 'column2', 'column3', 'column4']
|
||||
);
|
||||
|
||||
$table = new DefaultTable($tableMetaData);
|
||||
|
||||
$table->addRow([
|
||||
'table1_id' => 1,
|
||||
'column1' => 'My name is Mike Lively',
|
||||
'column2' => 200,
|
||||
'column3' => 34.64,
|
||||
'column4' => 'yghkf;a hahfg8ja h;'
|
||||
]);
|
||||
$table->addRow([
|
||||
'table1_id' => 2,
|
||||
'column1' => 'hk;afg',
|
||||
'column2' => 654,
|
||||
'column3' => 46.54,
|
||||
'column4' => '24rwehhads'
|
||||
]);
|
||||
$table->addRow([
|
||||
'table1_id' => 3,
|
||||
'column1' => 'ha;gyt',
|
||||
'column2' => 462,
|
||||
'column3' => '[NULL] not really',
|
||||
'column4' => '[NULL]'
|
||||
]);
|
||||
|
||||
$actual = new ReplacementTable($this->startingTable);
|
||||
$actual->addSubStrReplacement('%%%name%%%', 'Mike Lively');
|
||||
|
||||
TestCase::assertTablesEqual($table, $actual);
|
||||
}
|
||||
|
||||
public function testConstructorReplacements()
|
||||
{
|
||||
$tableMetaData = new DefaultTableMetadata(
|
||||
'table1', ['table1_id', 'column1', 'column2', 'column3', 'column4']
|
||||
);
|
||||
|
||||
$table = new DefaultTable($tableMetaData);
|
||||
|
||||
$table->addRow([
|
||||
'table1_id' => 1,
|
||||
'column1' => 'My name is Mike Lively',
|
||||
'column2' => 200,
|
||||
'column3' => 34.64,
|
||||
'column4' => 'yghkf;a hahfg8ja h;'
|
||||
]);
|
||||
$table->addRow([
|
||||
'table1_id' => 2,
|
||||
'column1' => 'hk;afg',
|
||||
'column2' => 654,
|
||||
'column3' => 46.54,
|
||||
'column4' => '24rwehhads'
|
||||
]);
|
||||
$table->addRow([
|
||||
'table1_id' => 3,
|
||||
'column1' => 'ha;gyt',
|
||||
'column2' => 462,
|
||||
'column3' => '[NULL] not really',
|
||||
'column4' => null
|
||||
]);
|
||||
|
||||
$actual = new ReplacementTable(
|
||||
$this->startingTable,
|
||||
['[NULL]' => null],
|
||||
['%%%name%%%' => 'Mike Lively']
|
||||
);
|
||||
|
||||
TestCase::assertTablesEqual($table, $actual);
|
||||
}
|
||||
|
||||
public function testGetRow()
|
||||
{
|
||||
$actual = new ReplacementTable(
|
||||
$this->startingTable,
|
||||
['[NULL]' => null],
|
||||
['%%%name%%%' => 'Mike Lively']
|
||||
);
|
||||
|
||||
$this->assertEquals(
|
||||
[
|
||||
'table1_id' => 1,
|
||||
'column1' => 'My name is Mike Lively',
|
||||
'column2' => 200,
|
||||
'column3' => 34.64,
|
||||
'column4' => 'yghkf;a hahfg8ja h;'
|
||||
],
|
||||
$actual->getRow(0)
|
||||
);
|
||||
|
||||
$this->assertEquals(
|
||||
[
|
||||
'table1_id' => 3,
|
||||
'column1' => 'ha;gyt',
|
||||
'column2' => 462,
|
||||
'column3' => '[NULL] not really',
|
||||
'column4' => null
|
||||
],
|
||||
$actual->getRow(2)
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetValue()
|
||||
{
|
||||
$actual = new ReplacementTable(
|
||||
$this->startingTable,
|
||||
['[NULL]' => null],
|
||||
['%%%name%%%' => 'Mike Lively']
|
||||
);
|
||||
|
||||
$this->assertNull($actual->getValue(2, 'column4'));
|
||||
$this->assertEquals('My name is Mike Lively', $actual->getValue(0, 'column1'));
|
||||
}
|
||||
|
||||
public function testMatchesWithNonMatchingMetaData()
|
||||
{
|
||||
$tableMetaData = $this->createMock(ITableMetadata::class);
|
||||
$otherMetaData = $this->createMock(ITableMetadata::class);
|
||||
$table = $this->createMock(ITable::class);
|
||||
$otherTable = $this->createMock(ITable::class);
|
||||
|
||||
$table->expects($this->once())
|
||||
->method('getTableMetaData')
|
||||
->will($this->returnValue($tableMetaData));
|
||||
|
||||
$otherTable->expects($this->once())
|
||||
->method('getTableMetaData')
|
||||
->will($this->returnValue($otherMetaData));
|
||||
|
||||
$tableMetaData->expects($this->once())
|
||||
->method('matches')
|
||||
->with($otherMetaData)
|
||||
->will($this->returnValue(false));
|
||||
|
||||
$replacementTable = new ReplacementTable($table);
|
||||
$this->assertFalse($replacementTable->matches($otherTable));
|
||||
}
|
||||
|
||||
public function testMatchesWithNonMatchingRowCount()
|
||||
{
|
||||
$tableMetaData = $this->createMock(ITableMetadata::class);
|
||||
$otherMetaData = $this->createMock(ITableMetadata::class);
|
||||
$table = $this->createMock(ITable::class);
|
||||
$otherTable = $this->createMock(ITable::class);
|
||||
|
||||
$replacementTable = $this->getMockBuilder(ReplacementTable::class)
|
||||
->setConstructorArgs([$table])
|
||||
->setMethods(['getRowCount'])
|
||||
->getMock();
|
||||
|
||||
$table->expects($this->once())
|
||||
->method('getTableMetaData')
|
||||
->will($this->returnValue($tableMetaData));
|
||||
|
||||
$otherTable->expects($this->once())
|
||||
->method('getTableMetaData')
|
||||
->will($this->returnValue($otherMetaData));
|
||||
$otherTable->expects($this->once())
|
||||
->method('getRowCount')
|
||||
->will($this->returnValue(0));
|
||||
|
||||
$tableMetaData->expects($this->once())
|
||||
->method('matches')
|
||||
->with($otherMetaData)
|
||||
->will($this->returnValue(true));
|
||||
|
||||
$replacementTable->expects($this->once())
|
||||
->method('getRowCount')
|
||||
->will($this->returnValue(1));
|
||||
$this->assertFalse($replacementTable->matches($otherTable));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $tableColumnValues
|
||||
* @param array $otherColumnValues
|
||||
* @param bool $matches
|
||||
* @dataProvider providerMatchesWithColumnValueComparisons
|
||||
*/
|
||||
public function testMatchesWithColumnValueComparisons($tableColumnValues, $otherColumnValues, $matches)
|
||||
{
|
||||
$tableMetaData = $this->createMock(ITableMetadata::class);
|
||||
$otherMetaData = $this->createMock(ITableMetadata::class);
|
||||
$table = $this->createMock(ITable::class);
|
||||
$otherTable = $this->createMock(ITable::class);
|
||||
|
||||
$table->expects($this->once())
|
||||
->method('getTableMetaData')
|
||||
->will($this->returnValue($tableMetaData));
|
||||
|
||||
$otherTable->expects($this->once())
|
||||
->method('getTableMetaData')
|
||||
->will($this->returnValue($otherMetaData));
|
||||
$otherTable->expects($this->once())
|
||||
->method('getRowCount')
|
||||
->will($this->returnValue(count($otherColumnValues)));
|
||||
|
||||
$tableMetaData->expects($this->once())
|
||||
->method('getColumns')
|
||||
->will($this->returnValue(array_keys(reset($tableColumnValues))));
|
||||
$tableMetaData->expects($this->once())
|
||||
->method('matches')
|
||||
->with($otherMetaData)
|
||||
->will($this->returnValue(true));
|
||||
|
||||
$replacementTable = $this->getMockBuilder(ReplacementTable::class)
|
||||
->setConstructorArgs([$table])
|
||||
->setMethods(['getRowCount', 'getValue'])
|
||||
->getMock();
|
||||
|
||||
$replacementTable->expects($this->any())
|
||||
->method('getRowCount')
|
||||
->will($this->returnValue(count($tableColumnValues)));
|
||||
|
||||
$tableMap = [];
|
||||
$otherMap = [];
|
||||
foreach ($tableColumnValues as $rowIndex => $rowData) {
|
||||
foreach ($rowData as $columnName => $columnValue) {
|
||||
$tableMap[] = [$rowIndex, $columnName, $columnValue];
|
||||
$otherMap[] = [$rowIndex, $columnName, $otherColumnValues[$rowIndex][$columnName]];
|
||||
}
|
||||
}
|
||||
$replacementTable->expects($this->any())
|
||||
->method('getValue')
|
||||
->will($this->returnValueMap($tableMap));
|
||||
$otherTable->expects($this->any())
|
||||
->method('getValue')
|
||||
->will($this->returnValueMap($otherMap));
|
||||
|
||||
$this->assertSame($matches, $replacementTable->matches($otherTable));
|
||||
}
|
||||
|
||||
public function providerMatchesWithColumnValueComparisons()
|
||||
{
|
||||
return [
|
||||
|
||||
// One row, one column, matches
|
||||
[
|
||||
[
|
||||
['id' => 1],
|
||||
],
|
||||
[
|
||||
['id' => 1],
|
||||
],
|
||||
true,
|
||||
],
|
||||
|
||||
// One row, one column, does not match
|
||||
[
|
||||
[
|
||||
['id' => 1],
|
||||
],
|
||||
[
|
||||
['id' => 2],
|
||||
],
|
||||
false,
|
||||
],
|
||||
|
||||
// Multiple rows, one column, matches
|
||||
[
|
||||
[
|
||||
['id' => 1],
|
||||
['id' => 2],
|
||||
],
|
||||
[
|
||||
['id' => 1],
|
||||
['id' => 2],
|
||||
],
|
||||
true,
|
||||
],
|
||||
|
||||
// Multiple rows, one column, do not match
|
||||
[
|
||||
[
|
||||
['id' => 1],
|
||||
['id' => 2],
|
||||
],
|
||||
[
|
||||
['id' => 1],
|
||||
['id' => 3],
|
||||
],
|
||||
false,
|
||||
],
|
||||
|
||||
// Multiple rows, multiple columns, matches
|
||||
[
|
||||
[
|
||||
['id' => 1, 'name' => 'foo'],
|
||||
['id' => 2, 'name' => 'bar'],
|
||||
],
|
||||
[
|
||||
['id' => 1, 'name' => 'foo'],
|
||||
['id' => 2, 'name' => 'bar'],
|
||||
],
|
||||
true,
|
||||
],
|
||||
|
||||
// Multiple rows, multiple columns, do not match
|
||||
[
|
||||
[
|
||||
['id' => 1, 'name' => 'foo'],
|
||||
['id' => 2, 'name' => 'bar'],
|
||||
],
|
||||
[
|
||||
['id' => 1, 'name' => 'foo'],
|
||||
['id' => 2, 'name' => 'baz'],
|
||||
],
|
||||
false,
|
||||
],
|
||||
|
||||
// Int and int as string must match
|
||||
[
|
||||
[
|
||||
['id' => 42],
|
||||
],
|
||||
[
|
||||
['id' => '42'],
|
||||
],
|
||||
true,
|
||||
],
|
||||
|
||||
// Float and float as string must match
|
||||
[
|
||||
[
|
||||
['id' => 15.3],
|
||||
],
|
||||
[
|
||||
['id' => '15.3'],
|
||||
],
|
||||
true,
|
||||
],
|
||||
|
||||
// Int and float must match
|
||||
[
|
||||
[
|
||||
['id' => 18.00],
|
||||
],
|
||||
[
|
||||
['id' => 18],
|
||||
],
|
||||
true,
|
||||
],
|
||||
|
||||
// 0 and empty string must not match
|
||||
[
|
||||
[
|
||||
['id' => 0],
|
||||
],
|
||||
[
|
||||
['id' => ''],
|
||||
],
|
||||
false,
|
||||
],
|
||||
|
||||
// 0 and null must not match
|
||||
[
|
||||
[
|
||||
['id' => 0],
|
||||
],
|
||||
[
|
||||
['id' => null],
|
||||
],
|
||||
false,
|
||||
],
|
||||
|
||||
// empty string and null must not match
|
||||
[
|
||||
[
|
||||
['id' => ''],
|
||||
],
|
||||
[
|
||||
['id' => null],
|
||||
],
|
||||
false,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
106
vendor/phpunit/dbunit/tests/DataSet/XmlDataSetsTest.php
vendored
Normal file
106
vendor/phpunit/dbunit/tests/DataSet/XmlDataSetsTest.php
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use PHPUnit\DbUnit\Constraint\DataSetIsEqual;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultDataSet;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTable;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTableMetadata;
|
||||
use PHPUnit\DbUnit\DataSet\FlatXmlDataSet;
|
||||
use PHPUnit\DbUnit\DataSet\MysqlXmlDataSet;
|
||||
use PHPUnit\DbUnit\DataSet\XmlDataSet;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class Extensions_Database_DataSet_XmlDataSetsTest extends TestCase
|
||||
{
|
||||
protected $expectedDataSet;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$table1MetaData = new DefaultTableMetadata(
|
||||
'table1', ['table1_id', 'column1', 'column2', 'column3', 'column4']
|
||||
);
|
||||
$table2MetaData = new DefaultTableMetadata(
|
||||
'table2', ['table2_id', 'column5', 'column6', 'column7', 'column8']
|
||||
);
|
||||
|
||||
$table1 = new DefaultTable($table1MetaData);
|
||||
$table2 = new DefaultTable($table2MetaData);
|
||||
|
||||
$table1->addRow([
|
||||
'table1_id' => 1,
|
||||
'column1' => 'tgfahgasdf',
|
||||
'column2' => 200,
|
||||
'column3' => 34.64,
|
||||
'column4' => 'yghkf;a hahfg8ja h;'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 2,
|
||||
'column1' => 'hk;afg',
|
||||
'column2' => 654,
|
||||
'column3' => 46.54,
|
||||
'column4' => '24rwehhads'
|
||||
]);
|
||||
$table1->addRow([
|
||||
'table1_id' => 3,
|
||||
'column1' => 'ha;gyt',
|
||||
'column2' => 462,
|
||||
'column3' => 1654.4,
|
||||
'column4' => 'asfgklg'
|
||||
]);
|
||||
|
||||
$table2->addRow([
|
||||
'table2_id' => 1,
|
||||
'column5' => 'fhah',
|
||||
'column6' => 456,
|
||||
'column7' => 46.5,
|
||||
'column8' => 'fsdbghfdas'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 2,
|
||||
'column5' => 'asdhfoih',
|
||||
'column6' => 654,
|
||||
'column7' => null,
|
||||
'column8' => '43asdfhgj'
|
||||
]);
|
||||
$table2->addRow([
|
||||
'table2_id' => 3,
|
||||
'column5' => 'ajsdlkfguitah',
|
||||
'column6' => 654,
|
||||
'column7' => null,
|
||||
'column8' => null
|
||||
]);
|
||||
|
||||
$this->expectedDataSet = new DefaultDataSet([$table1, $table2]);
|
||||
}
|
||||
|
||||
public function testFlatXmlDataSet()
|
||||
{
|
||||
$constraint = new DataSetIsEqual($this->expectedDataSet);
|
||||
$xmlFlatDataSet = new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/FlatXmlDataSet.xml');
|
||||
|
||||
self::assertThat($xmlFlatDataSet, $constraint);
|
||||
}
|
||||
|
||||
public function testXmlDataSet()
|
||||
{
|
||||
$constraint = new DataSetIsEqual($this->expectedDataSet);
|
||||
$xmlDataSet = new XmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/XmlDataSet.xml');
|
||||
|
||||
self::assertThat($xmlDataSet, $constraint);
|
||||
}
|
||||
|
||||
public function testMysqlXmlDataSet()
|
||||
{
|
||||
$constraint = new DataSetIsEqual($this->expectedDataSet);
|
||||
$mysqlXmlDataSet = new MysqlXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/MysqlXmlDataSet.xml');
|
||||
|
||||
self::assertThat($mysqlXmlDataSet, $constraint);
|
||||
}
|
||||
}
|
||||
105
vendor/phpunit/dbunit/tests/Operation/OperationsMySQLTest.php
vendored
Normal file
105
vendor/phpunit/dbunit/tests/Operation/OperationsMySQLTest.php
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use PHPUnit\DbUnit\Database\DefaultConnection;
|
||||
use PHPUnit\DbUnit\DataSet\CompositeDataSet;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultDataSet;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTable;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTableMetadata;
|
||||
use PHPUnit\DbUnit\DataSet\FlatXmlDataSet;
|
||||
use PHPUnit\DbUnit\Operation\Truncate;
|
||||
use PHPUnit\DbUnit\TestCase;
|
||||
|
||||
require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'DatabaseTestUtility.php';
|
||||
|
||||
class Extensions_Database_Operation_OperationsMySQLTest extends TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
if (!extension_loaded('pdo_mysql')) {
|
||||
$this->markTestSkipped('pdo_mysql is required to run this test.');
|
||||
}
|
||||
|
||||
if (!defined('PHPUNIT_TESTSUITE_EXTENSION_DATABASE_MYSQL_DSN')) {
|
||||
$this->markTestSkipped('No MySQL server configured for this test.');
|
||||
}
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function getConnection()
|
||||
{
|
||||
return new DefaultConnection(DBUnitTestUtility::getMySQLDB(), 'mysql');
|
||||
}
|
||||
|
||||
public function getDataSet()
|
||||
{
|
||||
return new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/OperationsMySQLTestFixture.xml');
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Truncate::execute
|
||||
*/
|
||||
public function testTruncate()
|
||||
{
|
||||
$truncateOperation = new Truncate();
|
||||
$truncateOperation->execute($this->getConnection(), $this->getDataSet());
|
||||
|
||||
$expectedDataSet = new DefaultDataSet([
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table1',
|
||||
['table1_id', 'column1', 'column2', 'column3', 'column4'])
|
||||
),
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table2',
|
||||
['table2_id', 'table1_id', 'column5', 'column6', 'column7', 'column8'])
|
||||
),
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table3',
|
||||
['table3_id', 'table2_id', 'column9', 'column10', 'column11', 'column12'])
|
||||
),
|
||||
]);
|
||||
|
||||
$this->assertDataSetsEqual($expectedDataSet, $this->getConnection()->createDataSet());
|
||||
}
|
||||
|
||||
public function getCompositeDataSet()
|
||||
{
|
||||
$compositeDataset = new CompositeDataSet();
|
||||
|
||||
$dataset = $this->createXMLDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/TruncateCompositeTest.xml');
|
||||
$compositeDataset->addDataSet($dataset);
|
||||
|
||||
return $compositeDataset;
|
||||
}
|
||||
|
||||
public function testTruncateComposite()
|
||||
{
|
||||
$truncateOperation = new Truncate();
|
||||
$truncateOperation->execute($this->getConnection(), $this->getCompositeDataSet());
|
||||
|
||||
$expectedDataSet = new DefaultDataSet([
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table1',
|
||||
['table1_id', 'column1', 'column2', 'column3', 'column4'])
|
||||
),
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table2',
|
||||
['table2_id', 'table1_id', 'column5', 'column6', 'column7', 'column8'])
|
||||
),
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table3',
|
||||
['table3_id', 'table2_id', 'column9', 'column10', 'column11', 'column12'])
|
||||
),
|
||||
]);
|
||||
|
||||
$this->assertDataSetsEqual($expectedDataSet, $this->getConnection()->createDataSet());
|
||||
}
|
||||
}
|
||||
147
vendor/phpunit/dbunit/tests/Operation/OperationsTest.php
vendored
Normal file
147
vendor/phpunit/dbunit/tests/Operation/OperationsTest.php
vendored
Normal file
@@ -0,0 +1,147 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use PHPUnit\DbUnit\Database\DefaultConnection;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultDataSet;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTable;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTableMetadata;
|
||||
use PHPUnit\DbUnit\DataSet\FlatXmlDataSet;
|
||||
use PHPUnit\DbUnit\Operation\Delete;
|
||||
use PHPUnit\DbUnit\Operation\DeleteAll;
|
||||
use PHPUnit\DbUnit\Operation\Insert;
|
||||
use PHPUnit\DbUnit\Operation\Update;
|
||||
use PHPUnit\DbUnit\Operation\Truncate;
|
||||
use PHPUnit\DbUnit\Operation\Replace;
|
||||
use PHPUnit\DbUnit\TestCase;
|
||||
|
||||
require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'DatabaseTestUtility.php';
|
||||
|
||||
class Extensions_Database_Operation_OperationsTest extends TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
if (!extension_loaded('pdo_sqlite')) {
|
||||
$this->markTestSkipped('PDO/SQLite is required to run this test.');
|
||||
}
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function getConnection()
|
||||
{
|
||||
return new DefaultConnection(DBUnitTestUtility::getSQLiteMemoryDB(), 'sqlite');
|
||||
}
|
||||
|
||||
public function getDataSet()
|
||||
{
|
||||
return new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/OperationsTestFixture.xml');
|
||||
}
|
||||
|
||||
public function testDelete()
|
||||
{
|
||||
$deleteOperation = new Delete();
|
||||
|
||||
$deleteOperation->execute($this->getConnection(), new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/DeleteOperationTest.xml'));
|
||||
|
||||
$this->assertDataSetsEqual(new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/DeleteOperationResult.xml'), $this->getConnection()->createDataSet());
|
||||
}
|
||||
|
||||
public function testDeleteAll()
|
||||
{
|
||||
$deleteAllOperation = new DeleteAll();
|
||||
|
||||
$deleteAllOperation->execute($this->getConnection(), new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/DeleteAllOperationTest.xml'));
|
||||
|
||||
$expectedDataSet = new DefaultDataSet([
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table1',
|
||||
['table1_id', 'column1', 'column2', 'column3', 'column4'])
|
||||
),
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table2',
|
||||
['table2_id', 'column5', 'column6', 'column7', 'column8'])
|
||||
),
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table3',
|
||||
['table3_id', 'column9', 'column10', 'column11', 'column12'])
|
||||
),
|
||||
]);
|
||||
|
||||
$this->assertDataSetsEqual($expectedDataSet, $this->getConnection()->createDataSet());
|
||||
}
|
||||
|
||||
public function testTruncate()
|
||||
{
|
||||
$truncateOperation = new Truncate();
|
||||
|
||||
$truncateOperation->execute($this->getConnection(), new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/DeleteAllOperationTest.xml'));
|
||||
|
||||
$expectedDataSet = new DefaultDataSet([
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table1',
|
||||
['table1_id', 'column1', 'column2', 'column3', 'column4'])
|
||||
),
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table2',
|
||||
['table2_id', 'column5', 'column6', 'column7', 'column8'])
|
||||
),
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table3',
|
||||
['table3_id', 'column9', 'column10', 'column11', 'column12'])
|
||||
),
|
||||
]);
|
||||
|
||||
$this->assertDataSetsEqual($expectedDataSet, $this->getConnection()->createDataSet());
|
||||
}
|
||||
|
||||
public function testInsert()
|
||||
{
|
||||
$insertOperation = new Insert();
|
||||
|
||||
$insertOperation->execute($this->getConnection(), new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/InsertOperationTest.xml'));
|
||||
|
||||
$this->assertDataSetsEqual(new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/InsertOperationResult.xml'), $this->getConnection()->createDataSet());
|
||||
}
|
||||
|
||||
public function testUpdate()
|
||||
{
|
||||
$updateOperation = new Update();
|
||||
|
||||
$updateOperation->execute($this->getConnection(), new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/UpdateOperationTest.xml'));
|
||||
|
||||
$this->assertDataSetsEqual(new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/UpdateOperationResult.xml'), $this->getConnection()->createDataSet());
|
||||
}
|
||||
|
||||
public function testReplace()
|
||||
{
|
||||
$replaceOperation = new Replace();
|
||||
|
||||
$replaceOperation->execute($this->getConnection(), new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/ReplaceOperationTest.xml'));
|
||||
|
||||
$this->assertDataSetsEqual(new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/ReplaceOperationResult.xml'), $this->getConnection()->createDataSet());
|
||||
}
|
||||
|
||||
public function testInsertEmptyTable()
|
||||
{
|
||||
$insertOperation = new Insert();
|
||||
|
||||
$insertOperation->execute($this->getConnection(), new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/EmptyTableInsertTest.xml'));
|
||||
|
||||
$this->assertDataSetsEqual(new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/EmptyTableInsertResult.xml'), $this->getConnection()->createDataSet());
|
||||
}
|
||||
public function testInsertAllEmptyTables()
|
||||
{
|
||||
$insertOperation = new Insert();
|
||||
|
||||
$insertOperation->execute($this->getConnection(), new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/AllEmptyTableInsertTest.xml'));
|
||||
|
||||
$this->assertDataSetsEqual(new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/AllEmptyTableInsertResult.xml'), $this->getConnection()->createDataSet());
|
||||
}
|
||||
}
|
||||
174
vendor/phpunit/dbunit/tests/Operation/RowBasedTest.php
vendored
Normal file
174
vendor/phpunit/dbunit/tests/Operation/RowBasedTest.php
vendored
Normal file
@@ -0,0 +1,174 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use PHPUnit\DbUnit\Database\DefaultConnection;
|
||||
use PHPUnit\DbUnit\Database\Connection;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultDataSet;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTable;
|
||||
use PHPUnit\DbUnit\DataSet\DefaultTableMetadata;
|
||||
use PHPUnit\DbUnit\DataSet\FlatXmlDataSet;
|
||||
use PHPUnit\DbUnit\DataSet\ITable;
|
||||
use PHPUnit\DbUnit\DataSet\ITableMetadata;
|
||||
use PHPUnit\DbUnit\Operation\RowBased;
|
||||
use PHPUnit\DbUnit\TestCase;
|
||||
|
||||
require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'DatabaseTestUtility.php';
|
||||
|
||||
class Extensions_Database_Operation_RowBasedTest extends TestCase
|
||||
{
|
||||
protected function setUp()
|
||||
{
|
||||
if (!extension_loaded('pdo_sqlite')) {
|
||||
$this->markTestSkipped('PDO/SQLite is required to run this test.');
|
||||
}
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function getConnection()
|
||||
{
|
||||
return new DefaultConnection(DBUnitTestUtility::getSQLiteMemoryDB(), 'sqlite');
|
||||
}
|
||||
|
||||
public function getDataSet()
|
||||
{
|
||||
$tables = [
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table1',
|
||||
['table1_id', 'column1', 'column2', 'column3', 'column4'])
|
||||
),
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table2',
|
||||
['table2_id', 'column5', 'column6', 'column7', 'column8'])
|
||||
),
|
||||
new DefaultTable(
|
||||
new DefaultTableMetadata('table3',
|
||||
['table3_id', 'column9', 'column10', 'column11', 'column12'])
|
||||
),
|
||||
];
|
||||
|
||||
return new DefaultDataSet($tables);
|
||||
}
|
||||
|
||||
public function testExecute()
|
||||
{
|
||||
$connection = $this->getConnection();
|
||||
/* @var $connection DefaultConnection */
|
||||
$table1 = new DefaultTable(
|
||||
new DefaultTableMetadata('table1', ['table1_id', 'column1', 'column2', 'column3', 'column4'])
|
||||
);
|
||||
|
||||
$table1->addRow([
|
||||
'table1_id' => 1,
|
||||
'column1' => 'foo',
|
||||
'column2' => 42,
|
||||
'column3' => 4.2,
|
||||
'column4' => 'bar'
|
||||
]);
|
||||
|
||||
$table1->addRow([
|
||||
'table1_id' => 2,
|
||||
'column1' => 'qwerty',
|
||||
'column2' => 23,
|
||||
'column3' => 2.3,
|
||||
'column4' => 'dvorak'
|
||||
]);
|
||||
|
||||
$table2 = new DefaultTable(
|
||||
new DefaultTableMetadata('table2', ['table2_id', 'column5', 'column6', 'column7', 'column8'])
|
||||
);
|
||||
|
||||
$table2->addRow([
|
||||
'table2_id' => 1,
|
||||
'column5' => 'fdyhkn',
|
||||
'column6' => 64,
|
||||
'column7' => 4568.64,
|
||||
'column8' => 'hkladfg'
|
||||
]);
|
||||
|
||||
$dataSet = new DefaultDataSet([$table1, $table2]);
|
||||
|
||||
$mockOperation = $this->createPartialMock(
|
||||
RowBased::class,
|
||||
['buildOperationQuery', 'buildOperationArguments']
|
||||
);
|
||||
|
||||
/* @var $mockOperation PHPUnit_Framework_MockObject_MockObject */
|
||||
$mockOperation->expects($this->at(0))
|
||||
->method('buildOperationQuery')
|
||||
->with($connection->createDataSet()->getTableMetaData('table1'), $table1)
|
||||
->will(
|
||||
$this->returnValue('INSERT INTO table1 (table1_id, column1, column2, column3, column4) VALUES (?, ?, ?, ?, ?)')
|
||||
);
|
||||
|
||||
$mockOperation->expects($this->at(1))
|
||||
->method('buildOperationArguments')
|
||||
->with($connection->createDataSet()->getTableMetaData('table1'), $table1, 0)
|
||||
->will(
|
||||
$this->returnValue([1, 'foo', 42, 4.2, 'bar'])
|
||||
);
|
||||
|
||||
$mockOperation->expects($this->at(2))
|
||||
->method('buildOperationArguments')
|
||||
->with($connection->createDataSet()->getTableMetaData('table1'), $table1, 1)
|
||||
->will(
|
||||
$this->returnValue([2, 'qwerty', 23, 2.3, 'dvorak'])
|
||||
);
|
||||
|
||||
$mockOperation->expects($this->at(3))
|
||||
->method('buildOperationQuery')
|
||||
->with($connection->createDataSet()->getTableMetaData('table2'), $table2)
|
||||
->will(
|
||||
$this->returnValue('INSERT INTO table2 (table2_id, column5, column6, column7, column8) VALUES (?, ?, ?, ?, ?)')
|
||||
);
|
||||
|
||||
$mockOperation->expects($this->at(4))
|
||||
->method('buildOperationArguments')
|
||||
->with($connection->createDataSet()->getTableMetaData('table2'), $table2, 0)
|
||||
->will(
|
||||
$this->returnValue([1, 'fdyhkn', 64, 4568.64, 'hkladfg'])
|
||||
);
|
||||
|
||||
/* @var $mockOperation RowBased */
|
||||
$mockOperation->execute($connection, $dataSet);
|
||||
|
||||
$this->assertDataSetsEqual(new FlatXmlDataSet(dirname(__FILE__) . '/../_files/XmlDataSets/RowBasedExecute.xml'), $connection->createDataSet(['table1', 'table2']));
|
||||
}
|
||||
|
||||
public function testExecuteWithBadQuery()
|
||||
{
|
||||
$mockDatabaseDataSet = $this->createMock(DefaultDataSet::class);
|
||||
$mockDatabaseDataSet->expects($this->never())->method('getTableMetaData');
|
||||
|
||||
$mockConnection = $this->createMock(Connection::class);
|
||||
$mockConnection->expects($this->once())->method('createDataSet')->will($this->returnValue($mockDatabaseDataSet));
|
||||
foreach (['getConnection', 'disablePrimaryKeys', 'enablePrimaryKeys'] as $method) {
|
||||
$mockConnection->expects($this->never())->method($method);
|
||||
}
|
||||
|
||||
$mockTableMetaData = $this->createMock(ITableMetadata::class);
|
||||
$mockTableMetaData->expects($this->any())->method('getTableName')->will($this->returnValue('table'));
|
||||
$mockTable = $this->createMock(ITable::class);
|
||||
$mockTable->expects($this->any())->method('getTableMetaData')->will($this->returnValue($mockTableMetaData));
|
||||
$mockTable->expects($this->once())->method('getRowCount')->will($this->returnValue(0));
|
||||
|
||||
$mockDataSet = $this->createMock(DefaultDataSet::class);
|
||||
$mockDataSet->expects($this->once())->method('getIterator')->will($this->returnValue(new ArrayIterator([$mockTable])));
|
||||
|
||||
$mockOperation = $this->createPartialMock(
|
||||
RowBased::class,
|
||||
['buildOperationQuery', 'buildOperationArguments']
|
||||
);
|
||||
$mockOperation->expects($this->never())->method('buildOperationArguments');
|
||||
$mockOperation->expects($this->never())->method('buildOperationQuery');
|
||||
|
||||
$mockOperation->execute($mockConnection, $mockDataSet);
|
||||
}
|
||||
}
|
||||
4
vendor/phpunit/dbunit/tests/_files/CsvDataSets/table1.csv
vendored
Normal file
4
vendor/phpunit/dbunit/tests/_files/CsvDataSets/table1.csv
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
table1_id,column1,column2,column3,column4
|
||||
1,tgfahgasdf,200,34.64,"yghkf;a hahfg8ja h;"
|
||||
2,hk;afg,654,46.54,24rwehhads
|
||||
3,ha;gyt,462,1654.4,asfgklg
|
||||
|
5
vendor/phpunit/dbunit/tests/_files/CsvDataSets/table2.csv
vendored
Normal file
5
vendor/phpunit/dbunit/tests/_files/CsvDataSets/table2.csv
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
table2_id,column5,column6,column7,column8
|
||||
1,fhah,456,46.5,"fsdb, ghfdas"
|
||||
2,asdhfoih,654,blah,"43asd ""fhgj"" sfadh"
|
||||
3,ajsdlkfguitah,654,blah,"thesethasdl
|
||||
asdflkjsadf asdfsadfhl ""adsf, halsdf"" sadfhlasdf"
|
||||
|
131
vendor/phpunit/dbunit/tests/_files/DatabaseTestUtility.php
vendored
Normal file
131
vendor/phpunit/dbunit/tests/_files/DatabaseTestUtility.php
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
class DBUnitTestUtility
|
||||
{
|
||||
protected static $connection;
|
||||
protected static $mySQLConnection;
|
||||
|
||||
public static function getSQLiteMemoryDB()
|
||||
{
|
||||
if (self::$connection === null) {
|
||||
self::$connection = new PDO('sqlite::memory:');
|
||||
self::setUpDatabase(self::$connection);
|
||||
}
|
||||
|
||||
return self::$connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates connection to test MySQL database
|
||||
*
|
||||
* MySQL server must be installed locally, with root access
|
||||
* and empty password and listening on unix socket
|
||||
*
|
||||
* @return PDO
|
||||
*
|
||||
* @see DBUnitTestUtility::setUpMySqlDatabase()
|
||||
*/
|
||||
public static function getMySQLDB()
|
||||
{
|
||||
if (self::$mySQLConnection === null) {
|
||||
self::$mySQLConnection = new PDO(PHPUNIT_TESTSUITE_EXTENSION_DATABASE_MYSQL_DSN, PHPUNIT_TESTSUITE_EXTENSION_DATABASE_MYSQL_USERNAME, PHPUNIT_TESTSUITE_EXTENSION_DATABASE_MYSQL_PASSWORD);
|
||||
|
||||
self::setUpMySQLDatabase(self::$mySQLConnection);
|
||||
}
|
||||
|
||||
return self::$mySQLConnection;
|
||||
}
|
||||
|
||||
protected static function setUpDatabase(PDO $connection)
|
||||
{
|
||||
$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
$connection->exec(
|
||||
'CREATE TABLE IF NOT EXISTS table1 (
|
||||
table1_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
column1 VARCHAR(20),
|
||||
column2 INT(10),
|
||||
column3 DECIMAL(6,2),
|
||||
column4 TEXT
|
||||
)'
|
||||
);
|
||||
|
||||
$connection->exec(
|
||||
'CREATE TABLE IF NOT EXISTS table2 (
|
||||
table2_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
column5 VARCHAR(20),
|
||||
column6 INT(10),
|
||||
column7 DECIMAL(6,2),
|
||||
column8 TEXT
|
||||
)'
|
||||
);
|
||||
|
||||
$connection->exec(
|
||||
'CREATE TABLE IF NOT EXISTS table3 (
|
||||
table3_id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
column9 VARCHAR(20),
|
||||
column10 INT(10),
|
||||
column11 DECIMAL(6,2),
|
||||
column12 TEXT
|
||||
)'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates default testing schema for MySQL database
|
||||
*
|
||||
* Tables must containt foreign keys and use InnoDb storage engine
|
||||
* for constraint tests to be executed properly
|
||||
*
|
||||
* @param PDO $connection PDO instance representing connection to MySQL database
|
||||
*
|
||||
* @see DBUnitTestUtility::getMySQLDB()
|
||||
*/
|
||||
protected static function setUpMySqlDatabase(PDO $connection)
|
||||
{
|
||||
$connection->exec(
|
||||
'CREATE TABLE IF NOT EXISTS table1 (
|
||||
table1_id INTEGER AUTO_INCREMENT,
|
||||
column1 VARCHAR(20),
|
||||
column2 INT(10),
|
||||
column3 DECIMAL(6,2),
|
||||
column4 TEXT,
|
||||
PRIMARY KEY (table1_id)
|
||||
) ENGINE=INNODB;
|
||||
');
|
||||
|
||||
$connection->exec(
|
||||
'CREATE TABLE IF NOT EXISTS table2 (
|
||||
table2_id INTEGER AUTO_INCREMENT,
|
||||
table1_id INTEGER,
|
||||
column5 VARCHAR(20),
|
||||
column6 INT(10),
|
||||
column7 DECIMAL(6,2),
|
||||
column8 TEXT,
|
||||
PRIMARY KEY (table2_id),
|
||||
FOREIGN KEY (table1_id) REFERENCES table1(table1_id)
|
||||
) ENGINE=INNODB;
|
||||
');
|
||||
|
||||
$connection->exec(
|
||||
'CREATE TABLE IF NOT EXISTS table3 (
|
||||
table3_id INTEGER AUTO_INCREMENT,
|
||||
table2_id INTEGER,
|
||||
column9 VARCHAR(20),
|
||||
column10 INT(10),
|
||||
column11 DECIMAL(6,2),
|
||||
column12 TEXT,
|
||||
PRIMARY KEY (table3_id),
|
||||
FOREIGN KEY (table2_id) REFERENCES table2(table2_id)
|
||||
) ENGINE=INNODB;
|
||||
');
|
||||
}
|
||||
}
|
||||
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/AllEmptyTableInsertResult.xml
vendored
Normal file
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/AllEmptyTableInsertResult.xml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
|
||||
<table1 table1_id="2" column1="qwerty" column2="23" column3="2.3" column4="dvorak" />
|
||||
<table2 table2_id="1" column5="fdyhkn" column6="64" column7="4568.64" column8="hkladfg" />
|
||||
<table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
|
||||
<table3 table3_id="2" column9="asdfgh" column10="76" column11="9413.521" column12="ghgkj;guagfghjhfd" />
|
||||
<table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
|
||||
</dataset>
|
||||
4
vendor/phpunit/dbunit/tests/_files/XmlDataSets/AllEmptyTableInsertTest.xml
vendored
Normal file
4
vendor/phpunit/dbunit/tests/_files/XmlDataSets/AllEmptyTableInsertTest.xml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1/>
|
||||
</dataset>
|
||||
6
vendor/phpunit/dbunit/tests/_files/XmlDataSets/DeleteAllOperationTest.xml
vendored
Normal file
6
vendor/phpunit/dbunit/tests/_files/XmlDataSets/DeleteAllOperationTest.xml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="1" />
|
||||
<table2 table2_id="1" />
|
||||
<table3 table3_id="1" />
|
||||
</dataset>
|
||||
7
vendor/phpunit/dbunit/tests/_files/XmlDataSets/DeleteOperationResult.xml
vendored
Normal file
7
vendor/phpunit/dbunit/tests/_files/XmlDataSets/DeleteOperationResult.xml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
|
||||
<table2 table2_id="1" column5="fdyhkn" column6="64" column7="4568.64" column8="hkladfg" />
|
||||
<table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
|
||||
<table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
|
||||
</dataset>
|
||||
5
vendor/phpunit/dbunit/tests/_files/XmlDataSets/DeleteOperationTest.xml
vendored
Normal file
5
vendor/phpunit/dbunit/tests/_files/XmlDataSets/DeleteOperationTest.xml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="2" />
|
||||
<table3 table3_id="2" />
|
||||
</dataset>
|
||||
11
vendor/phpunit/dbunit/tests/_files/XmlDataSets/EmptyTableInsertResult.xml
vendored
Normal file
11
vendor/phpunit/dbunit/tests/_files/XmlDataSets/EmptyTableInsertResult.xml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
|
||||
<table1 table1_id="2" column1="qwerty" column2="23" column3="2.3" column4="dvorak" />
|
||||
<table2 table2_id="1" column5="fdyhkn" column6="64" column7="4568.64" column8="hkladfg" />
|
||||
<table2 table2_id="2" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
|
||||
<table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
|
||||
<table3 table3_id="2" column9="asdfgh" column10="76" column11="9413.521" column12="ghgkj;guagfghjhfd" />
|
||||
<table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
|
||||
<table3 table3_id="4" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
|
||||
</dataset>
|
||||
6
vendor/phpunit/dbunit/tests/_files/XmlDataSets/EmptyTableInsertTest.xml
vendored
Normal file
6
vendor/phpunit/dbunit/tests/_files/XmlDataSets/EmptyTableInsertTest.xml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1/>
|
||||
<table2 table2_id="2" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
|
||||
<table3 table3_id="4" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
|
||||
</dataset>
|
||||
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/FilteredTestComparison.xml
vendored
Normal file
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/FilteredTestComparison.xml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
|
||||
<table1 table1_id="2" column1="qwerty" column2="23" column3="2.3" column4="dvorak" />
|
||||
<table2 table2_id="1" column5="fdyhkn" column6="64" column7="4568.64" column8="hkladfg" />
|
||||
<table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
|
||||
<table3 table3_id="2" column9="asdfgh" column10="76" column11="9413.521" column12="ghgkj;guagfghjhfd" />
|
||||
<table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
|
||||
</dataset>
|
||||
8
vendor/phpunit/dbunit/tests/_files/XmlDataSets/FilteredTestFixture.xml
vendored
Normal file
8
vendor/phpunit/dbunit/tests/_files/XmlDataSets/FilteredTestFixture.xml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 column1="foo" column2="42" column3="4.2" column4="bar" />
|
||||
<table1 column1="qwerty" column2="23" column3="2.3" column4="dvorak" />
|
||||
<table3 column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
|
||||
<table3 column9="asdfgh" column10="76" column11="9413.521" column12="ghgkj;guagfghjhfd" />
|
||||
<table3 column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
|
||||
</dataset>
|
||||
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/FlatXmlDataSet.xml
vendored
Normal file
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/FlatXmlDataSet.xml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="1" column1="tgfahgasdf" column2="200" column3="34.64" column4="yghkf;a hahfg8ja h;" />
|
||||
<table1 table1_id="2" column1="hk;afg" column2="654" column3="46.54" column4="24rwehhads" />
|
||||
<table1 table1_id="3" column1="ha;gyt" column2="462" column3="1654.4" column4="asfgklg" />
|
||||
<table2 table2_id="1" column5="fhah" column6="456" column7="46.5" column8="fsdbghfdas" />
|
||||
<table2 table2_id="2" column5="asdhfoih" column6="654" column8="43asdfhgj" />
|
||||
<table2 table2_id="3" column5="ajsdlkfguitah" column6="654" />
|
||||
</dataset>
|
||||
32
vendor/phpunit/dbunit/tests/_files/XmlDataSets/FlatXmlWriter.xml
vendored
Normal file
32
vendor/phpunit/dbunit/tests/_files/XmlDataSets/FlatXmlWriter.xml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1
|
||||
col1="val1"
|
||||
col2="val2"
|
||||
col3="val3"
|
||||
/>
|
||||
<table1
|
||||
col1="val4"
|
||||
col2="val5"
|
||||
col3="val6"
|
||||
/>
|
||||
<table1
|
||||
col1="val7"
|
||||
col2="val8"
|
||||
col3="val9"
|
||||
/>
|
||||
<emptytable />
|
||||
<table2
|
||||
col1="val10"
|
||||
col2="val11"
|
||||
col3="val12"
|
||||
/>
|
||||
<table2
|
||||
col1="val13"
|
||||
col3="val14"
|
||||
/>
|
||||
<table2
|
||||
col1="val15"
|
||||
col2="val16"
|
||||
/>
|
||||
</dataset>
|
||||
7
vendor/phpunit/dbunit/tests/_files/XmlDataSets/FlatXmlWriterEntities.xml
vendored
Normal file
7
vendor/phpunit/dbunit/tests/_files/XmlDataSets/FlatXmlWriterEntities.xml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<dataset>
|
||||
<table1
|
||||
col1="1"
|
||||
col2="<?xml version="1.0"?><myxml>test</myxml>"
|
||||
/>
|
||||
</dataset>
|
||||
12
vendor/phpunit/dbunit/tests/_files/XmlDataSets/InsertOperationResult.xml
vendored
Normal file
12
vendor/phpunit/dbunit/tests/_files/XmlDataSets/InsertOperationResult.xml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
|
||||
<table1 table1_id="2" column1="qwerty" column2="23" column3="2.3" column4="dvorak" />
|
||||
<table1 table1_id="3" column1="ggfdsa" column2="4654" column3="45.65" column4="41gkjfdhyglj54dsfaf" />
|
||||
<table2 table2_id="1" column5="fdyhkn" column6="64" column7="4568.64" column8="hkladfg" />
|
||||
<table2 table2_id="2" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
|
||||
<table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
|
||||
<table3 table3_id="2" column9="asdfgh" column10="76" column11="9413.521" column12="ghgkj;guagfghjhfd" />
|
||||
<table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
|
||||
<table3 table3_id="4" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
|
||||
</dataset>
|
||||
6
vendor/phpunit/dbunit/tests/_files/XmlDataSets/InsertOperationTest.xml
vendored
Normal file
6
vendor/phpunit/dbunit/tests/_files/XmlDataSets/InsertOperationTest.xml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="3" column1="ggfdsa" column2="4654" column3="45.65" column4="41gkjfdhyglj54dsfaf" />
|
||||
<table2 table2_id="2" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
|
||||
<table3 table3_id="4" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
|
||||
</dataset>
|
||||
51
vendor/phpunit/dbunit/tests/_files/XmlDataSets/MysqlXmlDataSet.xml
vendored
Normal file
51
vendor/phpunit/dbunit/tests/_files/XmlDataSets/MysqlXmlDataSet.xml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<database name="database_name">
|
||||
<table_data name="table1">
|
||||
<row>
|
||||
<field name="table1_id">1</field>
|
||||
<field name="column1">tgfahgasdf</field>
|
||||
<field name="column2">200</field>
|
||||
<field name="column3">34.64</field>
|
||||
<field name="column4">yghkf;a hahfg8ja h;</field>
|
||||
</row>
|
||||
<row>
|
||||
<field name="table1_id">2</field>
|
||||
<field name="column1">hk;afg</field>
|
||||
<field name="column2">654</field>
|
||||
<field name="column3">46.54</field>
|
||||
<field name="column4">24rwehhads</field>
|
||||
</row>
|
||||
<row>
|
||||
<field name="table1_id">3</field>
|
||||
<field name="column1">ha;gyt</field>
|
||||
<field name="column2">462</field>
|
||||
<field name="column3">1654.4</field>
|
||||
<field name="column4">asfgklg</field>
|
||||
</row>
|
||||
</table_data>
|
||||
<table_data name="table2">
|
||||
<row>
|
||||
<field name="table2_id">1</field>
|
||||
<field name="column5">fhah</field>
|
||||
<field name="column6">456</field>
|
||||
<field name="column7">46.5</field>
|
||||
<field name="column8">fsdbghfdas</field>
|
||||
</row>
|
||||
<row>
|
||||
<field name="table2_id">2</field>
|
||||
<field name="column5">asdhfoih</field>
|
||||
<field name="column6">654</field>
|
||||
<field name="column7" xsi:nil="true" />
|
||||
<field name="column8">43asdfhgj</field>
|
||||
</row>
|
||||
<row>
|
||||
<field name="table2_id">3</field>
|
||||
<field name="column5">ajsdlkfguitah</field>
|
||||
<field name="column6">654</field>
|
||||
<field name="column7" xsi:nil="true" />
|
||||
<field name="column8" xsi:nil="true" />
|
||||
</row>
|
||||
</table_data>
|
||||
</database>
|
||||
</mysqldump>
|
||||
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/OperationsMySQLTestFixture.xml
vendored
Normal file
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/OperationsMySQLTestFixture.xml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
|
||||
<table1 table1_id="2" column1="qwerty" column2="23" column3="2.3" column4="dvorak" />
|
||||
<table2 table2_id="1" table1_id="2" column5="fdyhkn" column6="64" column7="4568.64" column8="hkladfg" />
|
||||
<table3 table3_id="1" table2_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
|
||||
<table3 table3_id="2" table2_id="1" column9="asdfgh" column10="76" column11="9413.521" column12="ghgkj;guagfghjhfd" />
|
||||
<table3 table3_id="3" table2_id="1" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
|
||||
</dataset>
|
||||
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/OperationsTestFixture.xml
vendored
Normal file
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/OperationsTestFixture.xml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
|
||||
<table1 table1_id="2" column1="qwerty" column2="23" column3="2.3" column4="dvorak" />
|
||||
<table2 table2_id="1" column5="fdyhkn" column6="64" column7="4568.64" column8="hkladfg" />
|
||||
<table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
|
||||
<table3 table3_id="2" column9="asdfgh" column10="76" column11="9413.521" column12="ghgkj;guagfghjhfd" />
|
||||
<table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
|
||||
</dataset>
|
||||
31
vendor/phpunit/dbunit/tests/_files/XmlDataSets/QueryDataSetTest.xml
vendored
Normal file
31
vendor/phpunit/dbunit/tests/_files/XmlDataSets/QueryDataSetTest.xml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1
|
||||
table1_id="1"
|
||||
column1="test"
|
||||
column2="10"
|
||||
column3="20.5"
|
||||
column4="query test"
|
||||
/>
|
||||
<table1
|
||||
table1_id="2"
|
||||
column1="foo"
|
||||
column2="20"
|
||||
column3="30.6"
|
||||
column4="query test 2"
|
||||
/>
|
||||
<table1
|
||||
table1_id="3"
|
||||
column1="bar"
|
||||
column2="30"
|
||||
column3="40.7"
|
||||
column4="query test 3"
|
||||
/>
|
||||
<table2
|
||||
table2_id="3"
|
||||
column5="blah"
|
||||
column6="40"
|
||||
column7="50.8"
|
||||
column8="query test 4"
|
||||
/>
|
||||
</dataset>
|
||||
12
vendor/phpunit/dbunit/tests/_files/XmlDataSets/ReplaceOperationResult.xml
vendored
Normal file
12
vendor/phpunit/dbunit/tests/_files/XmlDataSets/ReplaceOperationResult.xml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
|
||||
<table1 table1_id="2" column1="jgfdasg" column2="4654" column3="45.65" column4="41gkjfdhyglj54dsfaf" />
|
||||
<table1 table1_id="3" column1="ggfdsa" column2="45" column3="1.4" column4="asfhajj" />
|
||||
<table2 table2_id="1" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
|
||||
<table2 table2_id="2" column5="gasupj" column6="9165" column7="456.65" column8="asfdh sdghkj" />
|
||||
<table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
|
||||
<table3 table3_id="2" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
|
||||
<table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
|
||||
<table3 table3_id="4" column9="asdfgaf" column10="152" column11="465.4" column12="dsafhl;a sji[uh ;" />
|
||||
</dataset>
|
||||
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/ReplaceOperationTest.xml
vendored
Normal file
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/ReplaceOperationTest.xml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="2" column1="jgfdasg" column2="4654" column3="45.65" column4="41gkjfdhyglj54dsfaf" />
|
||||
<table1 table1_id="3" column1="ggfdsa" column2="45" column3="1.4" column4="asfhajj" />
|
||||
<table2 table2_id="1" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
|
||||
<table2 table2_id="2" column5="gasupj" column6="9165" column7="456.65" column8="asfdh sdghkj" />
|
||||
<table3 table3_id="2" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
|
||||
<table3 table3_id="4" column9="asdfgaf" column10="152" column11="465.4" column12="dsafhl;a sji[uh ;" />
|
||||
</dataset>
|
||||
6
vendor/phpunit/dbunit/tests/_files/XmlDataSets/RowBasedExecute.xml
vendored
Normal file
6
vendor/phpunit/dbunit/tests/_files/XmlDataSets/RowBasedExecute.xml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
|
||||
<table1 table1_id="2" column1="qwerty" column2="23" column3="2.3" column4="dvorak" />
|
||||
<table2 table2_id="1" column5="fdyhkn" column6="64" column7="4568.64" column8="hkladfg" />
|
||||
</dataset>
|
||||
49
vendor/phpunit/dbunit/tests/_files/XmlDataSets/TruncateCompositeTest.xml
vendored
Normal file
49
vendor/phpunit/dbunit/tests/_files/XmlDataSets/TruncateCompositeTest.xml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" ?>
|
||||
<dataset>
|
||||
<table name="table1">
|
||||
<column>table1_id</column>
|
||||
<column>column1</column>
|
||||
<column>column2</column>
|
||||
<column>column3</column>
|
||||
<column>column4</column>
|
||||
<row>
|
||||
<value>1</value>
|
||||
<null />
|
||||
<null />
|
||||
<null />
|
||||
<null />
|
||||
</row>
|
||||
</table>
|
||||
<table name="table2">
|
||||
<column>table2_id</column>
|
||||
<column>table1_id</column>
|
||||
<column>column5</column>
|
||||
<column>column6</column>
|
||||
<column>column7</column>
|
||||
<column>column8</column>
|
||||
<row>
|
||||
<value>1</value>
|
||||
<value>1</value>
|
||||
<null />
|
||||
<null />
|
||||
<null />
|
||||
<null />
|
||||
</row>
|
||||
</table>
|
||||
<table name="table3">
|
||||
<column>table3_id</column>
|
||||
<column>table2_id</column>
|
||||
<column>column9</column>
|
||||
<column>column10</column>
|
||||
<column>column11</column>
|
||||
<column>column12</column>
|
||||
<row>
|
||||
<value>1</value>
|
||||
<value>1</value>
|
||||
<null />
|
||||
<null />
|
||||
<null />
|
||||
<null />
|
||||
</row>
|
||||
</table>
|
||||
</dataset>
|
||||
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/UpdateOperationResult.xml
vendored
Normal file
9
vendor/phpunit/dbunit/tests/_files/XmlDataSets/UpdateOperationResult.xml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="1" column1="foo" column2="42" column3="4.2" column4="bar" />
|
||||
<table1 table1_id="2" column1="ggfdsa" column2="4654" column3="45.65" column4="41gkjfdhyglj54dsfaf" />
|
||||
<table2 table2_id="1" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
|
||||
<table3 table3_id="1" column9="hgdshhh" column10="94" column11="8745.94" column12="ghsf;ugjhgdsfyhjhkdfa" />
|
||||
<table3 table3_id="2" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
|
||||
<table3 table3_id="3" column9="itgewqe" column10="16" column11="1562.65" column12="jkkjhgjhgcfddfg" />
|
||||
</dataset>
|
||||
6
vendor/phpunit/dbunit/tests/_files/XmlDataSets/UpdateOperationTest.xml
vendored
Normal file
6
vendor/phpunit/dbunit/tests/_files/XmlDataSets/UpdateOperationTest.xml
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table1 table1_id="2" column1="ggfdsa" column2="4654" column3="45.65" column4="41gkjfdhyglj54dsfaf" />
|
||||
<table2 table2_id="1" column5="gfdsagfpwah" column6="464" column7="462.45" column8="hsafd;jhsadfyh;wafsfg gfv s,da b" />
|
||||
<table3 table3_id="2" column9="hoafsd" column10="54563" column11="14.54" column12="hsda8oh hklsdgsd hiisvinv mdsav;;" />
|
||||
</dataset>
|
||||
65
vendor/phpunit/dbunit/tests/_files/XmlDataSets/XmlDataSet.xml
vendored
Normal file
65
vendor/phpunit/dbunit/tests/_files/XmlDataSets/XmlDataSet.xml
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table name="table1">
|
||||
<column>table1_id</column>
|
||||
<column>column1</column>
|
||||
<column>column2</column>
|
||||
<column>column3</column>
|
||||
<column>column4</column>
|
||||
<row>
|
||||
<value>1</value>
|
||||
<value>tgfahgasdf</value>
|
||||
<value>200</value>
|
||||
<value>34.64</value>
|
||||
<value>yghkf;a hahfg8ja h;</value>
|
||||
</row>
|
||||
<row>
|
||||
<value>2</value>
|
||||
<value>hk;afg</value>
|
||||
<value>654</value>
|
||||
<value>46.54</value>
|
||||
<value>24rwehhads</value>
|
||||
</row>
|
||||
<row>
|
||||
<value>3</value>
|
||||
<value>ha;gyt</value>
|
||||
<value>462</value>
|
||||
<value>1654.4</value>
|
||||
<value>asfgklg</value>
|
||||
</row>
|
||||
</table>
|
||||
<table name="table2">
|
||||
<column>table2_id</column>
|
||||
<column>column5</column>
|
||||
<column>column6</column>
|
||||
<column>column7</column>
|
||||
<column>column8</column>
|
||||
<row>
|
||||
<value>1</value>
|
||||
<value>fhah</value>
|
||||
<value>456</value>
|
||||
<value>46.5</value>
|
||||
<value>fsdbghfdas</value>
|
||||
</row>
|
||||
<row>
|
||||
<value>2</value>
|
||||
<value>asdhfoih</value>
|
||||
<value>654</value>
|
||||
<null />
|
||||
<value>43asdfhgj</value>
|
||||
</row>
|
||||
<row>
|
||||
<value>3</value>
|
||||
<value>ajsdlkfguitah</value>
|
||||
<value>654</value>
|
||||
<null />
|
||||
<null />
|
||||
</row>
|
||||
</table>
|
||||
<table1 table1_id="1" column1="tgfahgasdf" column2="200" column3="34.64" column4="yghkf;a hahfg8ja h;" />
|
||||
<table1 table1_id="2" column1="hk;afg" column2="654" column3="46.54" column4="24rwehhads" />
|
||||
<table1 table1_id="3" column1="ha;gyt" column2="462" column3="1654.4" column4="asfgklg" />
|
||||
<table2 table2_id="1" column5="fhah" column6="456" column7="46.5" column8="fsdbghfdas" />
|
||||
<table2 table2_id="2" column5="asdhfoih" column6="654" column8="43asdfhgj" />
|
||||
<table2 table2_id="3" column5="ajsdlkfguitah" column6="654" />
|
||||
</dataset>
|
||||
28
vendor/phpunit/dbunit/tests/_files/XmlDataSets/XmlWriter.xml
vendored
Normal file
28
vendor/phpunit/dbunit/tests/_files/XmlDataSets/XmlWriter.xml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<dataset>
|
||||
<table name="table1">
|
||||
<column>col1</column>
|
||||
<column>col2</column>
|
||||
<column>col3</column>
|
||||
<row>
|
||||
<value>val1</value>
|
||||
<value>val2</value>
|
||||
<value>val3</value>
|
||||
</row>
|
||||
<row>
|
||||
<value></value>
|
||||
<null />
|
||||
<value>val4</value>
|
||||
</row>
|
||||
<row>
|
||||
<value>val5</value>
|
||||
<value>val6</value>
|
||||
<value>val7</value>
|
||||
</row>
|
||||
</table>
|
||||
<table name="table2">
|
||||
<column>col1</column>
|
||||
<column>col2</column>
|
||||
<column>col3</column>
|
||||
</table>
|
||||
</dataset>
|
||||
11
vendor/phpunit/dbunit/tests/_files/XmlDataSets/XmlWriterEntities.xml
vendored
Normal file
11
vendor/phpunit/dbunit/tests/_files/XmlDataSets/XmlWriterEntities.xml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<dataset>
|
||||
<table name="table1">
|
||||
<column>col1</column>
|
||||
<column>col2</column>
|
||||
<row>
|
||||
<value>1</value>
|
||||
<value><?xml version="1.0"?><myxml>test</myxml></value>
|
||||
</row>
|
||||
</table>
|
||||
</dataset>
|
||||
44
vendor/phpunit/dbunit/tests/_files/YamlDataSets/testDataSet.yaml
vendored
Normal file
44
vendor/phpunit/dbunit/tests/_files/YamlDataSets/testDataSet.yaml
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
table1:
|
||||
-
|
||||
table1_id: 1
|
||||
column1: "tgfahgasdf"
|
||||
column2: 200
|
||||
column3: 34.64
|
||||
column4: "yghkf;a hahfg8ja h;"
|
||||
-
|
||||
table1_id: 2
|
||||
column1: "hk;afg"
|
||||
column2: 654
|
||||
column3: 46.54
|
||||
column4: 24rwehhads
|
||||
extraColumn: 'causes no worries'
|
||||
-
|
||||
table1_id: 3
|
||||
column1: ha;gyt
|
||||
column2: 462
|
||||
column3: 1654.4
|
||||
column4: asfgklg
|
||||
table2:
|
||||
-
|
||||
table2_id: 1
|
||||
column5: fhah
|
||||
column6: 456
|
||||
column7: 46.5
|
||||
column8: "fsdb, ghfdas"
|
||||
-
|
||||
table2_id: 2
|
||||
column5: asdhfoih
|
||||
column6: 654
|
||||
column7: blah
|
||||
column8: "43asd \"fhgj\" sfadh"
|
||||
-
|
||||
table2_id: 3
|
||||
column5: ajsdlkfguitah
|
||||
column6: 654
|
||||
column7: blah
|
||||
column8: |-
|
||||
thesethasdl
|
||||
asdflkjsadf asdfsadfhl "adsf, halsdf" sadfhlasdf
|
||||
|
||||
emptyTable:
|
||||
|
||||
Reference in New Issue
Block a user