Skip to content

Commit

Permalink
php8
Browse files Browse the repository at this point in the history
  • Loading branch information
jarektkaczyk committed Nov 29, 2020
1 parent d6225e5 commit 3b6a6aa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: php

php:
- 7.1
- 7.2
- 7.4
- 8.0

install:
- travis_retry composer require php-coveralls/php-coveralls:^2.0@stable
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"php": ">=7.1.0"
},
"require-dev": {
"phpunit/phpunit" : "^7.0"
"phpunit/phpunit" : ">=9.1"
},
"autoload": {
"psr-4": {
Expand Down
20 changes: 9 additions & 11 deletions tests/FsmTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

namespace Sofa\Unit\StateMachine;

use Sofa\StateMachine\Fsm;
use PHPUnit\Framework\TestCase;
use Sofa\StateMachine\Transition;
use Sofa\StateMachine\DuplicateActionException;
use Sofa\StateMachine\Fsm;
use Sofa\StateMachine\InvalidActionException;
use Sofa\StateMachine\StateMachineInterface;
use Sofa\StateMachine\Transition;

class FsmTest extends TestCase
{
protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand Down Expand Up @@ -51,24 +53,20 @@ public function it_allows_customizing_transitions_logic()
$this->assertEquals('customized', $this->stateful_object->prop);
}

/**
* @test
* @expectedException Sofa\StateMachine\DuplicateActionException
*/
/** @test */
public function it_rejects_invalid_transition_definitions()
{
$this->expectException(DuplicateActionException::class);
new Fsm(new StatefulDouble, [
Transition::make('off', 'start', 'idle'),
Transition::make('off', 'start', 'moving'),
]);
}

/**
* @test
* @expectedException Sofa\StateMachine\InvalidActionException
*/
/** @test */
public function it_rejects_invalid_action_for_processing()
{
$this->expectException(InvalidActionException::class);
$this->fsm->process('move');
}
}
Expand Down

0 comments on commit 3b6a6aa

Please sign in to comment.