| Total Complexity | 2 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class SiteTreeExtensionTest extends SapphireTest |
||
| 10 | { |
||
| 11 | protected $usesDatabase = true; |
||
| 12 | |||
| 13 | protected static $required_extensions = [ |
||
| 14 | SiteTree::class => [ |
||
| 15 | SiteTreeExtension::class, |
||
| 16 | ], |
||
| 17 | ]; |
||
| 18 | |||
| 19 | public function testAddToCampaignButtonIsAdded() |
||
| 20 | { |
||
| 21 | $this->logInWithPermission(); |
||
| 22 | |||
| 23 | $page = new SiteTree(); |
||
| 24 | $page->write(); |
||
| 25 | $actions = $page->getCMSActions(); |
||
| 26 | |||
| 27 | $informationField = $actions->fieldByName('ActionMenus.MoreOptions.action_addtocampaign'); |
||
| 28 | $this->assertNotNull($informationField, 'Add To Campaign button should have been added'); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function testAddToCampaignButtonIsNotAddedWhenUserDoesNotHavePermission() |
||
| 42 | } |
||
| 43 | } |
||
| 44 |