Page MenuHomeDevCentral

No OneTemporary

diff --git a/composer.json b/composer.json
index a04b14e..ec91cf4 100644
--- a/composer.json
+++ b/composer.json
@@ -1,23 +1,23 @@
{
"name": "keruald/database",
"description": "Allow to query a database",
"type": "library",
"require-dev": {
"phan/phan": "^5.3.2",
"squizlabs/php_codesniffer": "^3.6.2",
- "phpunit/phpunit": "^9.5",
+ "phpunit/phpunit": "^10.2",
"nasqueron/codestyle": "^0.0.1"
},
"scripts": {
"lint-src": "find src -type f -name '*.php' | xargs -n1 php -l",
"lint-tests": "find tests -type f -name '*.php' | xargs -n1 php -l",
"test": "vendor/bin/phpunit"
},
"license": "BSD-2-Clause",
"autoload": {
"psr-4": {
"Keruald\\Database\\": "src/",
"Keruald\\Database\\Tests\\": "tests/"
}
}
}
diff --git a/phpunit.xml b/phpunit.xml
index f5c1939..76ca7f8 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -1,24 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
+ xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
- convertErrorsToExceptions="true"
- convertNoticesToExceptions="true"
- convertWarningsToExceptions="true"
+ cacheDirectory=".phpunit.cache"
stopOnFailure="false">
<php>
<ini name="display_errors" value="On" />
<ini name="display_startup_errors" value="On" />
<ini name="error_reporting" value="On" />
</php>
<testsuites>
<testsuite name="Unit tests">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
- <coverage processUncoveredFiles="true">
+ <source>
<include>
<directory suffix=".php">src/</directory>
</include>
- </coverage>
+ </source>
</phpunit>
diff --git a/tests/Engines/BlackholeEngineTest.php b/tests/Engines/BlackholeEngineTest.php
index c71dadb..4490852 100644
--- a/tests/Engines/BlackholeEngineTest.php
+++ b/tests/Engines/BlackholeEngineTest.php
@@ -1,59 +1,58 @@
<?php
namespace Keruald\Database\Tests\Engines;
use Keruald\Database\Database;
use Keruald\Database\Engines\BlackholeEngine;
+use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
class BlackholeEngineTest extends TestCase {
private BlackholeEngine $db;
protected function setUp () : void {
$this->db = new BlackholeEngine();
}
public function testGetUnderlyingDriver () {
$this->assertNull($this->db->getUnderlyingDriver());
}
public function testQuery () {
$this->assertTrue($this->db->query(""));
}
public function testNextId () {
$this->assertEquals(0, $this->db->nextId());
}
public function testIsExistingTable () {
$this->assertTrue($this->db->isExistingTable("quux", "quuxians"));
}
- public function provideStringsToEscape () : iterable {
+ public static function provideStringsToEscape () : iterable {
yield ["Lorem ipsum"];
yield [""];
yield ["\\\\ \n"];
}
- /**
- * @dataProvider provideStringsToEscape
- */
+ #[DataProvider('provideStringsToEscape')]
public function testEscape ($string) {
$this->assertEquals($string, $this->db->escape($string));
}
public function testLoad () {
$config = [
'engine' => BlackholeEngine::class,
];
$engine = Database::load($config);
$this->assertInstanceOf(BlackholeEngine::class, $engine);
}
public function testCountAffectedRows () {
$this->assertEquals(0, $this->db->nextId());
}
}

File Metadata

Mime Type
text/x-diff
Expires
Fri, Feb 28, 21:50 (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2447903
Default Alt Text
(3 KB)

Event Timeline