Skip to content

Commit 7940bfe

Browse files
fixed testsetup
1 parent 8ab1c59 commit 7940bfe

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"doctrine/orm": "^2.5"
2020
},
2121
"require-dev": {
22-
"phpunit/phpunit": "^4.8",
22+
"phpunit/phpunit": "^4.8 || ^5.7",
2323
"symfony/framework-bundle": "^2.6",
2424
"symfony/finder": "^2.6",
2525
"doctrine/doctrine-bundle": "^1.5",

tests/Functional/Handler/TaskHandlerFactoryTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Task\TaskBundle\Tests\Functional\Handler;
1313

1414
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
15-
use Task\Handler\TaskHandlerNotExistsException;
1615
use Task\TaskBundle\Handler\TaskHandlerFactory;
1716
use Task\TaskBundle\Tests\Functional\TestHandler;
1817

@@ -39,10 +38,11 @@ public function testCreate()
3938
$this->assertInstanceOf(TestHandler::class, $this->taskHandlerFactory->create(TestHandler::class));
4039
}
4140

41+
/**
42+
* @expectedException \Task\Handler\TaskHandlerNotExistsException
43+
*/
4244
public function testCreateNotExists()
4345
{
44-
$this->setExpectedException(TaskHandlerNotExistsException::class);
45-
4646
$this->taskHandlerFactory->create(\stdClass::class);
4747
}
4848
}

tests/Unit/Builder/TaskBuilderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Task\TaskBundle\Unit\Builder;
44

55
use Task\Scheduler\TaskSchedulerInterface;
6-
use Task\TaskBundle\Builder\NotSupportedMethodException;
76
use Task\TaskBundle\Builder\TaskBuilder;
87
use Task\TaskBundle\Entity\Task;
98
use Task\TaskInterface;
@@ -21,10 +20,11 @@ public function testSetSystemKey()
2120
$task->setSystemKey('test')->shouldBeCalled();
2221
}
2322

23+
/**
24+
* @expectedException \Task\TaskBundle\Builder\NotSupportedMethodException
25+
*/
2426
public function testSetSystemKeyNotSupported()
2527
{
26-
$this->setExpectedException(NotSupportedMethodException::class);
27-
2828
$task = $this->prophesize(TaskInterface::class);
2929
$scheduler = $this->prophesize(TaskSchedulerInterface::class);
3030

tests/Unit/Handler/TaskHandlerFactoryTest.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Task\TaskBundle\Tests\Unit\Handler;
1313

14-
use Task\Handler\TaskHandlerNotExistsException;
1514
use Task\TaskBundle\Handler\TaskHandlerFactory;
1615
use Task\TaskBundle\Tests\Functional\TestHandler;
1716

@@ -28,19 +27,21 @@ public function testCreate()
2827
$this->assertEquals($handler, $taskHandlerFactory->create(TestHandler::class));
2928
}
3029

30+
/**
31+
* @expectedException \Task\Handler\TaskHandlerNotExistsException
32+
*/
3133
public function testCreateNotExists()
3234
{
33-
$this->setExpectedException(TaskHandlerNotExistsException::class);
34-
3535
$taskHandlerFactory = new TaskHandlerFactory([TestHandler::class => new TestHandler()]);
3636

3737
$taskHandlerFactory->create(\stdClass::class);
3838
}
3939

40+
/**
41+
* @expectedException \Task\Handler\TaskHandlerNotExistsException
42+
*/
4043
public function testCreateNoHandler()
4144
{
42-
$this->setExpectedException(TaskHandlerNotExistsException::class);
43-
4445
$taskHandlerFactory = new TaskHandlerFactory([]);
4546

4647
$taskHandlerFactory->create(\stdClass::class);

0 commit comments

Comments
 (0)