2017-11-19 20:49:41 +00:00
|
|
|
<?php
|
2021-04-14 15:17:01 +00:00
|
|
|
/** @license MIT
|
|
|
|
* Copyright 2017 J. King, Dustin Wilson et al.
|
|
|
|
* See LICENSE and AUTHORS files for details */
|
|
|
|
|
2017-11-19 20:49:41 +00:00
|
|
|
declare(strict_types=1);
|
2021-04-14 15:17:01 +00:00
|
|
|
|
2017-12-22 03:47:19 +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 03:47:19 +00:00
|
|
|
class TestResultEmpty extends \JKingWeb\Arsse\Test\AbstractTest {
|
2020-01-20 18:52:48 +00:00
|
|
|
public function testGetChangeCountAndLastInsertId(): void {
|
2017-12-22 03:47:19 +00:00
|
|
|
$r = new ResultEmpty;
|
2017-11-19 20:49:41 +00:00
|
|
|
$this->assertEquals(0, $r->changes());
|
|
|
|
$this->assertEquals(0, $r->lastId());
|
|
|
|
}
|
|
|
|
|
2020-01-20 18:52:48 +00:00
|
|
|
public function testIterateOverResults(): void {
|
2017-11-19 20:49:41 +00:00
|
|
|
$rows = [];
|
2017-12-22 03:47:19 +00:00
|
|
|
foreach (new ResultEmpty as $index => $row) {
|
2017-11-19 20:49:41 +00:00
|
|
|
$rows[$index] = $row['col'];
|
|
|
|
}
|
|
|
|
$this->assertEquals([], $rows);
|
|
|
|
}
|
|
|
|
|
2020-01-20 18:52:48 +00:00
|
|
|
public function testGetSingleValues(): void {
|
2017-12-22 03:47:19 +00:00
|
|
|
$test = new ResultEmpty;
|
2017-11-19 20:49:41 +00:00
|
|
|
$this->assertSame(null, $test->getValue());
|
|
|
|
}
|
|
|
|
|
2020-01-20 18:52:48 +00:00
|
|
|
public function testGetRows(): void {
|
2017-12-22 03:47:19 +00:00
|
|
|
$test = new ResultEmpty;
|
2017-11-19 20:49:41 +00:00
|
|
|
$this->assertSame(null, $test->getRow());
|
|
|
|
}
|
|
|
|
|
2020-01-20 18:52:48 +00:00
|
|
|
public function testGetAllRows(): void {
|
2017-12-22 03:47:19 +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
|
|
|
}
|