Skip to content

Commit 3ee876b

Browse files
HeahDudelyrixx
authored andcommitted
[Workflow] Fixed validator tests and used static function to create workflows
1 parent 05c3e86 commit 3ee876b

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/Symfony/Component/Workflow/Exception/InvalidDefinitionException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
*
1717
* @author Tobias Nyholm <[email protected]>
1818
*/
19-
class InvalidDefinitionException extends \LogicException implements ExceptionInterface
19+
class InvalidDefinitionException extends LogicException
2020
{
2121
}

src/Symfony/Component/Workflow/Tests/Validator/WorkflowValidatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
use Symfony\Component\Workflow\Transition;
88
use Symfony\Component\Workflow\Validator\WorkflowValidator;
99

10-
class WorkflowValidatorTest extends WorkflowTest
10+
class WorkflowValidatorTest extends \PHPUnit_Framework_TestCase
1111
{
1212
/**
1313
* @expectedException \Symfony\Component\Workflow\Exception\InvalidDefinitionException
1414
* @expectedExceptionMessage The marking store of workflow "foo" can not store many places.
1515
*/
1616
public function testSinglePlaceWorkflowValidatorAndComplexWorkflow()
1717
{
18-
$definition = $this->createComplexWorkflow();
18+
$definition = WorkflowTest::createComplexWorkflow();
1919

2020
(new WorkflowValidator(true))->validate($definition, 'foo');
2121
}

src/Symfony/Component/Workflow/Tests/WorkflowTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public function testGetMarkingWithEmptyDefinition()
4747
public function testGetMarkingWithImpossiblePlace()
4848
{
4949
$subject = new \stdClass();
50-
$subject->marking = null;
5150
$subject->marking = array('nope' => true);
5251
$workflow = new Workflow(new Definition(array(), array()), new MultipleStateMarkingStore());
5352

@@ -210,7 +209,7 @@ public function testGetEnabledTransitions()
210209
$this->assertSame('t5', $transitions[0]->getName());
211210
}
212211

213-
protected function createComplexWorkflow()
212+
public static function createComplexWorkflow()
214213
{
215214
$builder = new DefinitionBuilder();
216215

0 commit comments

Comments
 (0)