2017-11-19 20:49:41 +00:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
2017-12-22 16:41:54 +00:00
|
|
|
namespace JKingWeb\Arsse\TestCase\Db;
|
|
|
|
|
|
|
|
use JKingWeb\Arsse\Db\ResultEmpty;
|
2017-11-19 20:49:41 +00:00
|
|
|
|
|
|
|
/** @covers \JKingWeb\Arsse\Db\ResultEmpty<extended> */
|
2017-12-22 16:41:54 +00:00
|
|
|
class TestResultEmpty extends \JKingWeb\Arsse\Test\AbstractTest {
|
2017-11-19 20:49:41 +00:00
|
|
|
public function testGetChangeCountAndLastInsertId() {
|
2017-12-22 16:41:54 +00:00
|
|
|
$r = new ResultEmpty;
|
2017-11-19 20:49:41 +00:00
|
|
|
$this->assertEquals(0, $r->changes());
|
|
|
|
$this->assertEquals(0, $r->lastId());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testIterateOverResults() {
|
|
|
|
$rows = [];
|
2017-12-22 16:41:54 +00:00
|
|
|
foreach (new ResultEmpty as $index => $row) {
|
2017-11-19 20:49:41 +00:00
|
|
|
$rows[$index] = $row['col'];
|
|
|
|
}
|
|
|
|
$this->assertEquals([], $rows);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetSingleValues() {
|
2017-12-22 16:41:54 +00:00
|
|
|
$test = new ResultEmpty;
|
2017-11-19 20:49:41 +00:00
|
|
|
$this->assertSame(null, $test->getValue());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetRows() {
|
2017-12-22 16:41:54 +00:00
|
|
|
$test = new ResultEmpty;
|
2017-11-19 20:49:41 +00:00
|
|
|
$this->assertSame(null, $test->getRow());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetAllRows() {
|
2017-12-22 16:41:54 +00:00
|
|
|
$test = new ResultEmpty;
|
2017-11-19 20:49:41 +00:00
|
|
|
$rows = [];
|
|
|
|
$this->assertEquals($rows, $test->getAll());
|
|
|
|
}
|
2017-11-30 03:42:50 +00:00
|
|
|
}
|