Skip to content

Commit bbcc917

Browse files
committed
单元测试调整
1 parent 7c67aef commit bbcc917

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
"php": ">=8.0.0",
1717
"ext-json": "*",
1818
"ext-pdo": "*",
19-
"psr/simple-cache": ">=1.0",
2019
"psr/log": ">=1.0",
21-
"topthink/think-helper":"^3.1",
22-
"topthink/think-validate":"^3.0"
20+
"psr/simple-cache": "^3.0",
21+
"topthink/think-helper": "^3.1",
22+
"topthink/think-validate": "^3.0"
2323
},
2424
"require-dev": {
2525
"phpunit/phpunit": "^9.6|^10"

tests/orm/CacheTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use PHPUnit\Framework\TestCase;
66
use think\db\CacheItem;
7-
// use think\db\exception\InvalidArgumentException;
7+
use think\db\exception\InvalidArgumentException;
88
use DateTime;
99
use DateInterval;
1010
use DateTimeInterface;
@@ -155,8 +155,8 @@ public function testCacheItemInvalidExpiration(): void
155155
{
156156
$cache = new CacheItem('invalid_expire_key');
157157

158-
$this->expectException(\Error::class);
159-
$this->expectExceptionMessage('Interface "Psr\SimpleCache\InvalidArgumentException" not found');
158+
$this->expectException(InvalidArgumentException::class);
159+
$this->expectExceptionMessage('not support datetime');
160160

161161
$cache->expire('invalid_date_string');
162162
}
@@ -165,8 +165,8 @@ public function testCacheItemInvalidExpiresAfter(): void
165165
{
166166
$cache = new CacheItem('invalid_expires_after_key');
167167

168-
$this->expectException(\Error::class);
169-
$this->expectExceptionMessage('Interface "Psr\SimpleCache\InvalidArgumentException" not found');
168+
$this->expectException(InvalidArgumentException::class);
169+
$this->expectExceptionMessage('not support datetime');
170170

171171
$cache->expiresAfter('invalid_interval');
172172
}

0 commit comments

Comments
 (0)