Included vendor/ to the project
This commit is contained in:
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'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user