1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 09:02:41 +00:00
Arsse/tests/cases/Db/TestResultEmpty.php

39 lines
1.1 KiB
PHP
Raw Normal View History

<?php
declare(strict_types=1);
2017-12-22 03:47:19 +00:00
namespace JKingWeb\Arsse\TestCase\Db;
use JKingWeb\Arsse\Db\ResultEmpty;
/** @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;
$this->assertEquals(0, $r->changes());
$this->assertEquals(0, $r->lastId());
}
2020-01-20 18:52:48 +00:00
public function testIterateOverResults(): void {
$rows = [];
2017-12-22 03:47:19 +00:00
foreach (new ResultEmpty as $index => $row) {
$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;
$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;
$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;
$rows = [];
$this->assertEquals($rows, $test->getAll());
}
2017-11-30 03:42:50 +00:00
}