Skip to content

Commit

Permalink
Update dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
enumag committed Jul 27, 2018
1 parent cd5c959 commit 1371302
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
},
"require-dev": {
"arachne/codeception": "^0.8.0",
"codeception/codeception": "^2.3.2",
"codeception/codeception": "^2.4.3",
"friendsofphp/php-cs-fixer": "^2.8.0",
"phpstan/phpstan": "^0.9.0",
"phpstan/phpstan-nette": "^0.9.0"
"phpstan/phpstan": "^0.10.0",
"phpstan/phpstan-nette": "^0.10.0",
"phpstan/phpstan-strict-rules": "^0.10.0"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
includes:
- vendor/phpstan/phpstan-nette/extension.neon
- vendor/phpstan/phpstan-nette/rules.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/arachne/codeception/extension.neon

parameters:
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/src/CsrfExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class CsrfExtensionTest extends Unit

public function testExtension(): void
{
$this->assertInstanceOf(CsrfTokenManager::class, $this->tester->grabService(CsrfTokenManagerInterface::class));
$this->assertInstanceOf(UriSafeTokenGenerator::class, $this->tester->grabService(TokenGeneratorInterface::class));
$this->assertInstanceOf(SessionTokenStorage::class, $this->tester->grabService(TokenStorageInterface::class));
self::assertInstanceOf(CsrfTokenManager::class, $this->tester->grabService(CsrfTokenManagerInterface::class));
self::assertInstanceOf(UriSafeTokenGenerator::class, $this->tester->grabService(TokenGeneratorInterface::class));
self::assertInstanceOf(SessionTokenStorage::class, $this->tester->grabService(TokenStorageInterface::class));
}
}
18 changes: 9 additions & 9 deletions tests/integration/src/SessionTokenStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ public function _before(): void
{
/** @var SessionTokenStorage $storage */
$storage = $this->tester->grabService(TokenStorageInterface::class);
$this->assertInstanceOf(SessionTokenStorage::class, $storage);
self::assertInstanceOf(SessionTokenStorage::class, $storage);
$this->storage = $storage;
}

public function testMethods(): void
{
$this->assertFalse($this->storage->hasToken('tokenId'));
self::assertFalse($this->storage->hasToken('tokenId'));
$this->storage->setToken('tokenId', 'tokenValue');
$this->assertTrue($this->storage->hasToken('tokenId'));
$this->assertSame('tokenValue', $this->storage->getToken('tokenId'));
$this->assertTrue($this->storage->hasToken('tokenId'));
$this->assertSame('tokenValue', $this->storage->removeToken('tokenId'));
$this->assertFalse($this->storage->hasToken('tokenId'));
$this->assertNull($this->storage->removeToken('tokenId'));
self::assertTrue($this->storage->hasToken('tokenId'));
self::assertSame('tokenValue', $this->storage->getToken('tokenId'));
self::assertTrue($this->storage->hasToken('tokenId'));
self::assertSame('tokenValue', $this->storage->removeToken('tokenId'));
self::assertFalse($this->storage->hasToken('tokenId'));
self::assertNull($this->storage->removeToken('tokenId'));
}

public function testException(): void
{
try {
$this->storage->getToken('tokenId');
$this->fail();
self::fail();
} catch (TokenNotFoundException $exception) {
self::assertSame('The CSRF token with ID "tokenId" does not exist.', $exception->getMessage());
}
Expand Down

0 comments on commit 1371302

Please sign in to comment.