Completed
Pull Request — master (#70)
by Daniel
01:50
created

SiteTreePublishingEngineTest::testDeleteStaleFiles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 11
nc 1
nop 0
1
<?php
2
3
namespace SilverStripe\StaticPublishQueue\Test;
4
5
use SilverStripe\Dev\SapphireTest;
6
use SilverStripe\StaticPublishQueue\Test\SiteTreePublishingEngineTest\Model\StaticPublishingTriggerPage;
7
8
class SiteTreePublishingEngineTest extends SapphireTest
9
{
10
11 View Code Duplication
    public function testCollectChangesForPublishing()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
    {
13
        $obj = StaticPublishingTriggerPage::create();
14
        $obj->collectChanges(['action' => 'publish']);
15
16
        $this->assertEquals(
17
            '/updateOnPublish',
18
            $obj->getToUpdate()->first()->url
19
        );
20
        $this->assertEquals(
21
            '/deleteOnPublish',
22
            $obj->getToDelete()->first()->url
23
        );
24
    }
25
26 View Code Duplication
    public function testCollectChangesForUnpublishing()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
    {
28
        $obj = StaticPublishingTriggerPage::create();
29
        $obj->collectChanges(['action' => 'unpublish']);
30
31
        $this->assertEquals(
32
            '/updateOnUnpublish',
33
            $obj->getToUpdate()->first()->url
34
        );
35
        $this->assertEquals(
36
            '/deleteOnUnpublish',
37
            $obj->getToDelete()->first()->url
38
        );
39
    }
40
}
41