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

44 lines
1.2 KiB
PHP
Raw Normal View History

<?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 */
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;
/** @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
}