Skip to content
Closed
Changes from 1 commit
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
Next Next commit
Added failing test
  • Loading branch information
Nyholm committed Aug 12, 2016
commit 33f45e5da22f62bcb54fc0677d38a73af660eea3
14 changes: 14 additions & 0 deletions src/Symfony/Component/Workflow/Tests/WorkflowTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,20 @@ public function testCan()
$this->assertFalse($workflow->can($subject, 't2'));
}

public function testCanWithInitialState()
{
$definition = $this->createComplexWorkflow();
$workflow = new Workflow($definition, new PropertyAccessorMarkingStore());
$subject = new \stdClass();

$subject->marking = array('b'=>1, 'c'=>1);
$this->assertTrue($workflow->can($subject, 't2'));

// If you are in place b you should be able to apply t2
$subject->marking = array('b'=>1);
$this->assertTrue($workflow->can($subject, 't2'));
}

public function testCanWithGuard()
{
$definition = $this->createComplexWorkflow();
Expand Down