|
2 | 2 |
|
3 | 3 | namespace Tarantool\SymfonyLock\Tests;
|
4 | 4 |
|
| 5 | +use InvalidArgumentException; |
5 | 6 | use PHPUnit\Framework\TestCase;
|
| 7 | +use Symfony\Component\Lock\Exception\InvalidTtlException; |
6 | 8 | use Symfony\Component\Lock\Exception\LockConflictedException;
|
7 | 9 | use Symfony\Component\Lock\Key;
|
8 | 10 | use Symfony\Component\Lock\PersistingStoreInterface;
|
@@ -188,4 +190,52 @@ public function testCleanerLimit()
|
188 | 190 | $this->assertSame(0, $cleaner->process());
|
189 | 191 | $this->assertCount(1, $space->select(Criteria::key([])));
|
190 | 192 | }
|
| 193 | + |
| 194 | + public function testSchemaInvalidEngine() |
| 195 | + { |
| 196 | + $this->expectException(InvalidArgumentException::class); |
| 197 | + $this->expectExceptionMessage("Engine should be defined"); |
| 198 | + |
| 199 | + new SchemaManager(Client::fromDefaults(), [ 'engine' => '' ]); |
| 200 | + } |
| 201 | + |
| 202 | + public function testSchemaInvalidSpaceName() |
| 203 | + { |
| 204 | + $this->expectException(InvalidArgumentException::class); |
| 205 | + $this->expectExceptionMessage("Space should be defined"); |
| 206 | + |
| 207 | + new SchemaManager(Client::fromDefaults(), [ 'space' => '' ]); |
| 208 | + } |
| 209 | + |
| 210 | + public function testCleanerInvalidLimit() |
| 211 | + { |
| 212 | + $this->expectException(InvalidArgumentException::class); |
| 213 | + $this->expectExceptionMessage("Limit expects a strictly positive. Got 0"); |
| 214 | + |
| 215 | + new Cleaner(Client::fromDefaults(), [ 'limit' => 0 ]); |
| 216 | + } |
| 217 | + |
| 218 | + public function testCleanerInvalidSpaceName() |
| 219 | + { |
| 220 | + $this->expectException(InvalidArgumentException::class); |
| 221 | + $this->expectExceptionMessage("Space should be defined"); |
| 222 | + |
| 223 | + new Cleaner(Client::fromDefaults(), [ 'space' => '' ]); |
| 224 | + } |
| 225 | + |
| 226 | + public function testStoreInvalidTtl() |
| 227 | + { |
| 228 | + $this->expectException(InvalidTtlException::class); |
| 229 | + $this->expectExceptionMessage("InitialTtl expects a strictly positive TTL. Got 0."); |
| 230 | + |
| 231 | + new TarantoolStore(Client::fromDefaults(), [ 'initialTtl' => 0 ]); |
| 232 | + } |
| 233 | + |
| 234 | + public function testStoreInvalidSpaceName() |
| 235 | + { |
| 236 | + $this->expectException(InvalidArgumentException::class); |
| 237 | + $this->expectExceptionMessage("Space should be defined"); |
| 238 | + |
| 239 | + new TarantoolStore(Client::fromDefaults(), [ 'space' => '' ]); |
| 240 | + } |
191 | 241 | }
|
0 commit comments