From 6df1cc2e04d174fa7c4a9193f7e0beaf525cad8f Mon Sep 17 00:00:00 2001 From: craig410 Date: Thu, 29 Oct 2020 16:11:05 +0000 Subject: [PATCH 1/4] Switch to Github Actions instead of Travis --- .github/workflows/test.yaml | 57 +++++++++++++++++++++++++++++++++++++ .travis.yml | 23 --------------- 2 files changed, 57 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/test.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..029af21 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,57 @@ +name: Run tests +on: + push: + branches: + # Only mainline branches, features etc are covered on the pull_request trigger + - '*.x' + pull_request: + +jobs: + run-tests: + runs-on: ubuntu-latest + name: Run tests + strategy: + fail-fast: false + matrix: + php_version: + - '7.2' + dependencies: + - 'default' + include: + - php_version: '7.2' + dependencies: 'lowest' + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_version }} + tools: composer:v2 + + - name: Checkout + uses: actions/checkout@v2 + + - name: Get composer cache directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer-${{ matrix.dependencies }} + + - name: Install composer dependencies + env: + DEPENDENCIES: ${{ matrix.dependencies }} + run: | + if [ $DEPENDENCIES == 'lowest' ] + then + composer update --prefer-lowest --no-interaction --no-suggest --no-progress + else + composer install --no-interaction --no-suggest --no-progress + fi + + - name: Run unit tests + run: | + vendor/bin/phpunit diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 91c34a5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -sudo: false -language: php -php: - - '7.2' - -# Only build main branches : feature branches will be covered by the PR builder -branches: - only: - - /^[0-9\.]+\.x$/ - -cache: - directories: - - $HOME/.composer/cache/files - -before_script: - - composer self-update - - composer install --prefer-dist --no-interaction - -script: - - vendor/bin/phpunit - -notifications: - email: false From b8b8878c2786dd3a8ac6a60aa1f3fd98937a1f70 Mon Sep 17 00:00:00 2001 From: craig410 Date: Thu, 29 Oct 2020 16:38:45 +0000 Subject: [PATCH 2/4] Require PHP ~7.4.11 --- .github/workflows/test.yaml | 4 ++-- composer.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 029af21..b967b60 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,11 +14,11 @@ jobs: fail-fast: false matrix: php_version: - - '7.2' + - '7.4' dependencies: - 'default' include: - - php_version: '7.2' + - php_version: '7.4' dependencies: 'lowest' steps: - name: Setup PHP diff --git a/composer.json b/composer.json index 7f248e7..08ed682 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ } ], "require": { - "php": "^7.2" + "php": "~7.4.11" }, "require-dev": { "phpunit/phpunit": "^7.0" From 3fb5532ba77c899b83f70b0e1ffc9c19f29a7e82 Mon Sep 17 00:00:00 2001 From: craig410 Date: Thu, 29 Oct 2020 16:55:44 +0000 Subject: [PATCH 3/4] Migrate to PHPUnit ^9.0 --- .github/workflows/test.yaml | 4 +-- README.md | 3 -- composer.json | 2 +- phpunit.xml | 34 +++++++++---------- .../Repository/ArrayUserRepositoryTest.php | 2 +- .../Repository/UserRepositoryTest.php | 22 ++++++------ test/unit/Config/ConfigurationTest.php | 20 +++++------ .../Interactor/AbstractInteractorTest.php | 3 +- .../ActivateAccountInteractorTest.php | 7 ++-- .../Interactor/ChangeEmailInteractorTest.php | 7 ++-- .../ChangePasswordInteractorTest.php | 2 +- .../EmailVerificationInteractorTest.php | 2 +- test/unit/Interactor/LoginInteractorTest.php | 22 ++++++------ .../PasswordResetInteractorTest.php | 2 +- .../UserRegistrationInteractorTest.php | 2 +- .../ConfirmationRequiredNotificationTest.php | 4 +-- .../StorageBackedLeakyBucketTest.php | 18 +++++----- .../Support/InteractorRequestFactoryTest.php | 2 +- test/unit/UserSession/UserSessionTest.php | 5 ++- 19 files changed, 75 insertions(+), 88 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b967b60..67fde89 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,9 +17,7 @@ jobs: - '7.4' dependencies: - 'default' - include: - - php_version: '7.4' - dependencies: 'lowest' + steps: - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/README.md b/README.md index f2ebcf4..13f22a6 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,6 @@ that can be assembled as required. **Warden is under heavy development and not recommended for production use outwith inGenerator.** -[![Build Status](https://travis-ci.org/ingenerator/warden-core.svg?branch=0.3.x)](https://travis-ci.org/ingenerator/warden-core) - - # Installing warden-core This isn't in packagist yet : you'll need to add our package repository to your composer.json: diff --git a/composer.json b/composer.json index 08ed682..22de99f 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "php": "~7.4.11" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^9.0" }, "suggest": { "ingenerator/warden-validator-symfony": "Default entity / request validation implemenation using symfony validation" diff --git a/phpunit.xml b/phpunit.xml index b61a4c9..51c7904 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,19 +1,19 @@ - + - - - - test/unit - - - test/integration - - + + + + + test/unit + + + test/integration + + diff --git a/test/integration/Repository/ArrayUserRepositoryTest.php b/test/integration/Repository/ArrayUserRepositoryTest.php index 01c2808..d01ee6c 100644 --- a/test/integration/Repository/ArrayUserRepositoryTest.php +++ b/test/integration/Repository/ArrayUserRepositoryTest.php @@ -16,7 +16,7 @@ class ArrayUserRepositoryTest extends UserRepositoryTest */ protected $storage; - public function setUp() + public function setUp(): void { parent::setUp(); $this->storage = new \ArrayObject; diff --git a/test/integration/Repository/UserRepositoryTest.php b/test/integration/Repository/UserRepositoryTest.php index a8a965d..d9e330a 100644 --- a/test/integration/Repository/UserRepositoryTest.php +++ b/test/integration/Repository/UserRepositoryTest.php @@ -10,9 +10,12 @@ use Ingenerator\Warden\Core\Config\Configuration; use Ingenerator\Warden\Core\Entity\SimpleUser; use Ingenerator\Warden\Core\Entity\User; +use Ingenerator\Warden\Core\Repository\DuplicateUserException; +use Ingenerator\Warden\Core\Repository\UnknownUserException; use Ingenerator\Warden\Core\Repository\UserRepository; +use PHPUnit\Framework\TestCase; -abstract class UserRepositoryTest extends \PHPUnit\Framework\TestCase +abstract class UserRepositoryTest extends TestCase { /** * @var Configuration @@ -55,19 +58,14 @@ public function test_saving_existing_user_does_not_change_id() $this->assertSame($original_id, $user->getId(), 'Existing ID should be retained on save'); } - /** - * @expectedException \Ingenerator\Warden\Core\Repository\DuplicateUserException - */ public function test_throws_duplicate_user_if_attempting_to_create_user_with_already_registered_email() { $email = \uniqid('duplicate').'@bar.ban'; $this->newSubject()->save($this->newUser(['email' => $email])); + $this->expectException(DuplicateUserException::class); $this->newSubject()->save($this->newUser(['email' => $email])); } - /** - * @expectedException \Ingenerator\Warden\Core\Repository\DuplicateUserException - */ public function test_throws_duplicate_user_if_attempting_to_update_user_to_other_users_email() { $other_user = $this->newUser(); @@ -75,6 +73,7 @@ public function test_throws_duplicate_user_if_attempting_to_update_user_to_other $this->given_saved_users($other_user, $this_user); $this_user->setEmail($other_user->getEmail()); + $this->expectException(DuplicateUserException::class); $this->newSubject()->save($this_user); } @@ -85,13 +84,14 @@ public function test_can_update_existing_user_with_same_email() $this->given_saved_users($user); $user->setPasswordHash('stuff'); $this->newSubject()->save($user); + + // if we got this far successfully assert something to satisfy PHPUnit + $this->assertTrue(TRUE); } - /** - * @expectedException \Ingenerator\Warden\Core\Repository\UnknownUserException - */ public function test_it_throws_if_loading_user_with_unknown_id() { + $this->expectException(UnknownUserException::class); $this->newSubject()->load(1234); } @@ -141,7 +141,7 @@ protected function newUser(array $values = []) return $user; } - public function setUp() + public function setUp(): void { parent::setUp(); $this->config = new Configuration([]); diff --git a/test/unit/Config/ConfigurationTest.php b/test/unit/Config/ConfigurationTest.php index 6d3aeda..dceaf16 100644 --- a/test/unit/Config/ConfigurationTest.php +++ b/test/unit/Config/ConfigurationTest.php @@ -9,6 +9,7 @@ use Ingenerator\Warden\Core\Config\Configuration; use Ingenerator\Warden\Core\Entity\SimpleUser; +use InvalidArgumentException; class ConfigurationTest extends \PHPUnit\Framework\TestCase { @@ -23,26 +24,25 @@ public function test_it_provides_default_config_when_no_overrides_provided() $this->assertSame(SimpleUser::class, $subject->getClassName('entity', 'user')); } - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage No classmap entry for foo.bar - */ public function test_it_throws_on_attempt_to_map_undefined_class() { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('No classmap entry for foo.bar'); $this->newSubject()->getClassName('foo', 'bar'); } - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Class \Some\Unknown\Class mapped for entity.user is not defined - */ public function test_it_throws_if_class_mapped_to_nonexistent_class() { - $this->newSubject( + $subject = $this->newSubject( [ 'classmap' => ['entity' => ['user' => '\Some\Unknown\Class']], ] - )->getClassName('entity', 'user'); + ); + + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Class \Some\Unknown\Class mapped for entity.user is not defined'); + + $subject->getClassName('entity', 'user'); } public function test_it_returns_mapped_class_name_if_defined() diff --git a/test/unit/Interactor/AbstractInteractorTest.php b/test/unit/Interactor/AbstractInteractorTest.php index 5d42a77..8134f33 100644 --- a/test/unit/Interactor/AbstractInteractorTest.php +++ b/test/unit/Interactor/AbstractInteractorTest.php @@ -8,8 +8,9 @@ use Ingenerator\Warden\Core\Interactor\AbstractResponse; +use PHPUnit\Framework\TestCase; -abstract class AbstractInteractorTest extends \PHPUnit\Framework\TestCase +abstract class AbstractInteractorTest extends TestCase { protected function assertFailsWithCode($code, AbstractResponse $result) diff --git a/test/unit/Interactor/ActivateAccountInteractorTest.php b/test/unit/Interactor/ActivateAccountInteractorTest.php index 48ff8c0..50cd9b3 100644 --- a/test/unit/Interactor/ActivateAccountInteractorTest.php +++ b/test/unit/Interactor/ActivateAccountInteractorTest.php @@ -12,6 +12,7 @@ use Ingenerator\Warden\Core\Interactor\ActivateAccountResponse; use Ingenerator\Warden\Core\Interactor\EmailVerificationRequest; use Ingenerator\Warden\Core\Repository\ArrayUserRepository; +use Ingenerator\Warden\Core\Repository\UnknownUserException; use Ingenerator\Warden\Core\Repository\UserRepository; use Ingenerator\Warden\Core\Support\EmailConfirmationTokenService; use Ingenerator\Warden\Core\UserSession\SimplePropertyUserSession; @@ -60,11 +61,9 @@ public function test_it_fails_if_details_are_not_valid() } - /** - * @expectedException \Ingenerator\Warden\Core\Repository\UnknownUserException - */ public function test_it_throws_if_user_does_not_exist() { + $this->expectException(UnknownUserException::class); $this->executeWith(['user_id' => 999]); } @@ -140,7 +139,7 @@ public function test_it_logs_in_user_on_success() $this->assertSame($user, $this->user_session->getUser()); } - public function setUp() + public function setUp(): void { parent::setUp(); $this->validator = ValidatorStub::alwaysValid(); diff --git a/test/unit/Interactor/ChangeEmailInteractorTest.php b/test/unit/Interactor/ChangeEmailInteractorTest.php index 0bc2005..ad34a8c 100644 --- a/test/unit/Interactor/ChangeEmailInteractorTest.php +++ b/test/unit/Interactor/ChangeEmailInteractorTest.php @@ -12,6 +12,7 @@ use Ingenerator\Warden\Core\Interactor\ChangeEmailResponse; use Ingenerator\Warden\Core\Interactor\EmailVerificationRequest; use Ingenerator\Warden\Core\Repository\ArrayUserRepository; +use Ingenerator\Warden\Core\Repository\UnknownUserException; use Ingenerator\Warden\Core\Repository\UserRepository; use Ingenerator\Warden\Core\Support\EmailConfirmationTokenService; use Ingenerator\Warden\Core\UserSession\SimplePropertyUserSession; @@ -60,11 +61,9 @@ public function test_it_fails_if_details_are_not_valid() } - /** - * @expectedException \Ingenerator\Warden\Core\Repository\UnknownUserException - */ public function test_it_throws_if_user_does_not_exist() { + $this->expectException(UnknownUserException::class); $result = $this->executeWith(['user_id' => 999]); $this->assertFailsWithCode(ChangeEmailResponse::ERROR_UNKNOWN_USER, $result); $this->assertSame('unknown@foo.bar', $result->getNewEmail()); @@ -207,7 +206,7 @@ public function test_it_logs_in_user_on_success() $this->assertSame($user, $this->user_session->getUser()); } - public function setUp() + public function setUp(): void { parent::setUp(); $this->validator = ValidatorStub::alwaysValid(); diff --git a/test/unit/Interactor/ChangePasswordInteractorTest.php b/test/unit/Interactor/ChangePasswordInteractorTest.php index 7ed0f37..47ca519 100644 --- a/test/unit/Interactor/ChangePasswordInteractorTest.php +++ b/test/unit/Interactor/ChangePasswordInteractorTest.php @@ -101,7 +101,7 @@ public function test_it_stores_and_saves_user_password_hash_on_success() $this->user_repo->assertOneSaved($user); } - public function setUp() + public function setUp(): void { parent::setUp(); $this->validator = ValidatorStub::alwaysValid(); diff --git a/test/unit/Interactor/EmailVerificationInteractorTest.php b/test/unit/Interactor/EmailVerificationInteractorTest.php index 07bb040..0a4d048 100644 --- a/test/unit/Interactor/EmailVerificationInteractorTest.php +++ b/test/unit/Interactor/EmailVerificationInteractorTest.php @@ -203,7 +203,7 @@ public function test_it_returns_rate_limited_response_without_sending_if_rate_li $this->user_notification->assertNothingSent(); } - public function setUp() + public function setUp(): void { parent::setUp(); $this->email_token_service = new InsecureJSONTokenServiceStub; diff --git a/test/unit/Interactor/LoginInteractorTest.php b/test/unit/Interactor/LoginInteractorTest.php index ff861c1..d5cc54c 100644 --- a/test/unit/Interactor/LoginInteractorTest.php +++ b/test/unit/Interactor/LoginInteractorTest.php @@ -24,6 +24,9 @@ use Ingenerator\Warden\Core\UserSession\SimplePropertyUserSession; use Ingenerator\Warden\Core\UserSession\UserSession; use Ingenerator\Warden\Core\Validator\Validator; +use LogicException; +use PHPUnit\Framework\Assert; +use PHPUnit\Framework\MockObject\MockObject; use test\mock\Ingenerator\Warden\Core\Entity\UserStub; use test\mock\Ingenerator\Warden\Core\RateLimit\LeakyBucketStub; use test\mock\Ingenerator\Warden\Core\Repository\SaveSpyingUserRepository; @@ -64,18 +67,13 @@ class LoginInteractorTest extends AbstractInteractorTest public function test_it_is_initialisable() { - $this->assertInstanceOf( - '\Ingenerator\Warden\Core\Interactor\LoginInteractor', - $this->newSubject() - ); + $this->assertInstanceOf(LoginInteractor::class, $this->newSubject()); } - /** - * @expectedException \LogicException - */ public function test_it_throws_if_user_already_logged_in() { $this->user_session->login(new SimpleUser); + $this->expectException(LogicException::class); $this->newSubject()->execute(LoginRequest::fromArray([])); } @@ -275,7 +273,7 @@ public function test_it_does_not_change_password_hash_on_failed_login(User $user $this->user_repo->assertNothingSaved(); } - public function test_it_does_not_send_any_user_notification_on_succesful_login() + public function test_it_does_not_send_any_user_notification_on_successful_login() { $this->email_verification = $this->getMockExpectingNoCalls( EmailVerificationInteractor::class @@ -388,7 +386,7 @@ public function test_it_responds_if_email_verification_details_invalid_for_activ } - public function setUp() + public function setUp(): void { parent::setUp(); $this->email_verification = new EmailVerificationInteractorSpy; @@ -437,7 +435,7 @@ protected function newSubject() /** * @param string $className * - * @return \PHPUnit\Framework\MockObject_MockObject + * @return MockObject */ protected function getMockExpectingNoCalls($className) { @@ -479,7 +477,7 @@ public function execute(EmailVerificationRequest $request) public function assertExecutedOnceWith(EmailVerificationRequest $request) { - \PHPUnit\Framework\Assert::assertCount(1, $this->calls); - \PHPUnit\Framework\Assert::assertEquals($request, $this->calls[0]); + Assert::assertCount(1, $this->calls); + Assert::assertEquals($request, $this->calls[0]); } } diff --git a/test/unit/Interactor/PasswordResetInteractorTest.php b/test/unit/Interactor/PasswordResetInteractorTest.php index eab53ee..dd1092c 100644 --- a/test/unit/Interactor/PasswordResetInteractorTest.php +++ b/test/unit/Interactor/PasswordResetInteractorTest.php @@ -220,7 +220,7 @@ public function test_it_logs_in_user_on_success() $this->assertSame($user, $this->user_session->getUser()); } - public function setUp() + public function setUp(): void { parent::setUp(); $this->validator = ValidatorStub::alwaysValid(); diff --git a/test/unit/Interactor/UserRegistrationInteractorTest.php b/test/unit/Interactor/UserRegistrationInteractorTest.php index 9bb91e3..dbeebb9 100644 --- a/test/unit/Interactor/UserRegistrationInteractorTest.php +++ b/test/unit/Interactor/UserRegistrationInteractorTest.php @@ -297,7 +297,7 @@ public function test_it_does_not_log_in_user_when_inactive_on_registration() $this->assertFalse($this->user_session->isAuthenticated()); } - public function setUp() + public function setUp(): void { parent::setUp(); $this->validator = ValidatorStub::alwaysValid(); diff --git a/test/unit/Notification/ConfirmationRequiredNotificationTest.php b/test/unit/Notification/ConfirmationRequiredNotificationTest.php index 4bf0d2c..919167e 100644 --- a/test/unit/Notification/ConfirmationRequiredNotificationTest.php +++ b/test/unit/Notification/ConfirmationRequiredNotificationTest.php @@ -53,12 +53,10 @@ public function test_it_has_no_user_if_unset() $this->assertSame(FALSE, $this->newSubject()->hasRecipientUser()); } - /** - * @expectedException \LogicException - */ public function test_it_throws_if_attempt_to_get_unset_user() { $this->recipient_user = NULL; + $this->expectException(\LogicException::class); $this->newSubject()->getRecipientUser(); } diff --git a/test/unit/RateLimit/StorageBackedLeakyBucketTest.php b/test/unit/RateLimit/StorageBackedLeakyBucketTest.php index da69fab..19cf516 100644 --- a/test/unit/RateLimit/StorageBackedLeakyBucketTest.php +++ b/test/unit/RateLimit/StorageBackedLeakyBucketTest.php @@ -8,7 +8,9 @@ use Ingenerator\Warden\Core\RateLimit\LeakyBucketStorage; +use Ingenerator\Warden\Core\RateLimit\LockWaitTimeoutException; use Ingenerator\Warden\Core\RateLimit\StorageBackedLeakyBucket; +use Ingenerator\Warden\Core\RateLimit\UndefinedRequestTypeException; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; @@ -39,9 +41,6 @@ public function test_it_is_initialisable() $this->assertInstanceOf(StorageBackedLeakyBucket::class, $this->newSubject()); } - /** - * @expectedException \Ingenerator\Warden\Core\RateLimit\UndefinedRequestTypeException - */ public function test_it_throws_if_no_config_for_request_type() { $this->config['bucket_types'] = [ @@ -50,12 +49,10 @@ public function test_it_throws_if_no_config_for_request_type() 'leak_time_seconds' => 100 ] ]; + $this->expectException(UndefinedRequestTypeException::class); $this->newSubject()->attemptRequest('foo.bar', 'anyone'); } - /** - * @expectedException \Ingenerator\Warden\Core\RateLimit\LockWaitTimeoutException - */ public function test_it_throws_if_unable_to_obtain_lock_after_timeout() { $this->config['bucket_lock'] = [ @@ -64,6 +61,7 @@ public function test_it_throws_if_unable_to_obtain_lock_after_timeout() 'lock_ttl_secs' => 5, ]; $this->storage = BucketStorageStub::neverGrantLock(); + $this->expectException(LockWaitTimeoutException::class); $this->newSubject()->attemptRequest('warden.email.reset', 'anybody'); } @@ -149,11 +147,11 @@ public function test_it_calculates_correct_time_to_next_availability() $this->newSubject()->attemptRequest('any', 'anything'); $result = $this->newSubject()->attemptRequest('any', 'anything'); $this->assertTrue($result->isRateLimited()); - $this->assertEquals( + $this->assertEqualsWithDelta( new \DateTimeImmutable('+30 seconds'), $result->getNextAvailableTime(), - 'Should be basically right time', - 1 + 1, + 'Should be basically right time' ); } @@ -172,7 +170,7 @@ protected function newSubject() ); } - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->storage = new BucketStorageStub; diff --git a/test/unit/Support/InteractorRequestFactoryTest.php b/test/unit/Support/InteractorRequestFactoryTest.php index 7c7350c..7d4c6a3 100644 --- a/test/unit/Support/InteractorRequestFactoryTest.php +++ b/test/unit/Support/InteractorRequestFactoryTest.php @@ -55,7 +55,7 @@ public function test_it_can_factory_custom_request_objects() $this->assertSame('foo@bar.com', $request->getEmail()); } - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->config = new Configuration([]); diff --git a/test/unit/UserSession/UserSessionTest.php b/test/unit/UserSession/UserSessionTest.php index cdd1d46..d1ca809 100644 --- a/test/unit/UserSession/UserSessionTest.php +++ b/test/unit/UserSession/UserSessionTest.php @@ -6,6 +6,7 @@ namespace test\unit\Ingenerator\Warden\Core\UserSession; +use BadMethodCallException; use Ingenerator\Warden\Core\Entity\SimpleUser; use Ingenerator\Warden\Core\UserSession\UserSession; use test\mock\Ingenerator\Warden\Core\Entity\UserStub; @@ -23,11 +24,9 @@ public function test_it_is_not_authenticated_by_default() $this->assertFalse($this->newSubject()->isAuthenticated()); } - /** - * @expectedException \BadMethodCallException - */ public function test_it_throws_when_attempting_to_access_user_if_not_authenticated() { + $this->expectException(BadMethodCallException::class); $this->newSubject()->getUser(); } From ace6ade34c124752f0544d8b55869318cef7a248 Mon Sep 17 00:00:00 2001 From: craig410 Date: Thu, 29 Oct 2020 17:31:05 +0000 Subject: [PATCH 4/4] Bump changelog for release --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bdc5be..aab5c28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ### Unreleased +### v1.1.0 (2020-10-29) + +* Support php7.4 + ### v1.0.0 (2019-04-03) * Ensure php7.2 support