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