|
@@ 85-105 (lines=21) @@
|
| 82 |
|
|
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
function testObjectsToUpdateOnPublishIfVirtualExists() { |
| 86 |
|
|
| 87 |
|
$redir = Object::create('PublishableSiteTreeTest_Publishable'); |
| 88 |
|
$redir->Title = 'virtual'; |
| 89 |
|
|
| 90 |
|
$stub = $this->getMock( |
| 91 |
|
'PublishableSiteTreeTest_Publishable', |
| 92 |
|
array('getMyVirtualPages') |
| 93 |
|
); |
| 94 |
|
$stub->Title = 'stub'; |
| 95 |
|
|
| 96 |
|
$stub->expects($this->once()) |
| 97 |
|
->method('getMyVirtualPages') |
| 98 |
|
->will($this->returnValue( |
| 99 |
|
new ArrayList(array($redir)) |
| 100 |
|
)); |
| 101 |
|
|
| 102 |
|
$objects = $stub->objectsToUpdate(array('action' => 'publish')); |
| 103 |
|
$this->assertTrue(in_array('virtual', $objects->column('Title'), 'Updates related virtual page')); |
| 104 |
|
|
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
function testObjectsToDeleteOnUnpublishIfVirtualExists() { |
| 108 |
|
|
|
@@ 107-127 (lines=21) @@
|
| 104 |
|
|
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
function testObjectsToDeleteOnUnpublishIfVirtualExists() { |
| 108 |
|
|
| 109 |
|
$redir = Object::create('PublishableSiteTreeTest_Publishable'); |
| 110 |
|
$redir->Title = 'virtual'; |
| 111 |
|
|
| 112 |
|
$stub = $this->getMock( |
| 113 |
|
'PublishableSiteTreeTest_Publishable', |
| 114 |
|
array('getMyVirtualPages') |
| 115 |
|
); |
| 116 |
|
$stub->Title = 'stub'; |
| 117 |
|
|
| 118 |
|
$stub->expects($this->once()) |
| 119 |
|
->method('getMyVirtualPages') |
| 120 |
|
->will($this->returnValue( |
| 121 |
|
new ArrayList(array($redir)) |
| 122 |
|
)); |
| 123 |
|
|
| 124 |
|
$objects = $stub->objectsToDelete(array('action' => 'unpublish')); |
| 125 |
|
$this->assertTrue(in_array('virtual', $objects->column('Title'), 'Deletes related virtual page')); |
| 126 |
|
|
| 127 |
|
} |
| 128 |
|
|
| 129 |
|
} |
| 130 |
|
|