@@ 76-88 (lines=13) @@ | ||
73 | /** |
|
74 | * Ensure WorkflowInstance returns expected values for a Published target object. |
|
75 | */ |
|
76 | public function testInstanceGetTargetPublished() |
|
77 | { |
|
78 | $def = $this->createDefinition(); |
|
79 | $target = $this->objFromFixture('SiteTree', 'published-object'); |
|
80 | $target->doPublish(); |
|
81 | ||
82 | $instance = $this->objFromFixture('WorkflowInstance', 'target-is-published'); |
|
83 | $instance->beginWorkflow($def); |
|
84 | $instance->execute(); |
|
85 | ||
86 | $this->assertTrue($target->isPublished()); |
|
87 | $this->assertEquals($target->ID, $instance->getTarget()->ID); |
|
88 | $this->assertEquals($target->Title, $instance->getTarget()->Title); |
|
89 | } |
|
90 | ||
91 | /** |
|
@@ 94-105 (lines=12) @@ | ||
91 | /** |
|
92 | * Ensure WorkflowInstance returns expected values for a Draft target object. |
|
93 | */ |
|
94 | public function testInstanceGetTargetDraft() |
|
95 | { |
|
96 | $def = $this->createDefinition(); |
|
97 | $target = $this->objFromFixture('SiteTree', 'draft-object'); |
|
98 | ||
99 | $instance = $this->objFromFixture('WorkflowInstance', 'target-is-draft'); |
|
100 | $instance->beginWorkflow($def); |
|
101 | $instance->execute(); |
|
102 | ||
103 | $this->assertFalse($target->isPublished()); |
|
104 | $this->assertEquals($target->ID, $instance->getTarget()->ID); |
|
105 | $this->assertEquals($target->Title, $instance->getTarget()->Title); |
|
106 | } |
|
107 | ||
108 | public function testPublishAction() |