Skip to content

[Workflow] Fixed some tests and cs #20507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
*
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
class InvalidDefinitionException extends \LogicException implements ExceptionInterface
class InvalidDefinitionException extends LogicException
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
use Symfony\Component\Workflow\Validator\SinglePlaceWorkflowValidator;
use Symfony\Component\Workflow\Workflow;

class SinglePlaceWorkflowValidatorTest extends WorkflowTest
class SinglePlaceWorkflowValidatorTest extends \PHPUnit_Framework_TestCase
{
/**
* @expectedException \Symfony\Component\Workflow\Exception\InvalidDefinitionException
* @expectedExceptionMessage The marking store of workflow "foo" can not store many places.
*/
public function testSinglePlaceWorkflowValidatorAndComplexWorkflow()
{
$definition = $this->createComplexWorkflow();
$definition = WorkflowTest::createComplexWorkflow();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just create a minimal workflow here. I thought of this as well for #20492 but i forgot :))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


(new SinglePlaceWorkflowValidator())->validate($definition, 'foo');
}
Expand Down
3 changes: 1 addition & 2 deletions src/Symfony/Component/Workflow/Tests/WorkflowTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public function testGetMarkingWithEmptyDefinition()
public function testGetMarkingWithImpossiblePlace()
{
$subject = new \stdClass();
$subject->marking = null;
$subject->marking = array('nope' => true);
$workflow = new Workflow(new Definition(array(), array()), new MultipleStateMarkingStore());

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

protected function createComplexWorkflow()
public static function createComplexWorkflow()
{
$builder = new DefinitionBuilder();

Expand Down