DMSEmbargoTest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 192
Duplicated Lines 36.46 %

Coupling/Cohesion

Components 0
Dependencies 10

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 10
dl 70
loc 192
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A createFakeHTTPRequest() 0 6 1
A testBasicEmbargo() 0 32 1
A testEmbargoIndefinitely() 0 17 1
A testExpireAtDate() 34 34 1
A testEmbargoUntilDate() 36 36 1
B testEmbargoUntilPublished() 0 57 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
class DMSEmbargoTest extends SapphireTest
3
{
4
    protected static $fixture_file = 'dmsembargotest.yml';
5
6
    public function createFakeHTTPRequest($id)
7
    {
8
        $r = new SS_HTTPRequest('GET', 'index/'.$id);
9
        $r->match('index/$ID');
10
        return $r;
11
    }
12
13
    public function testBasicEmbargo()
14
    {
15
        $oldTestMode = DMSDocument_Controller::$testMode;
16
        Config::inst()->update('DMS', 'folder_name', 'assets/_unit-test-123');
17
18
        $doc = DMS::inst()->storeDocument('dms/tests/DMS-test-lorum-file.pdf');
19
        $doc->CanViewType = 'LoggedInUsers';
20
        $docID = $doc->write();
21
22
        //fake a request for a document
23
        $controller = new DMSDocument_Controller();
24
        DMSDocument_Controller::$testMode = true;
25
        $result = $controller->index($this->createFakeHTTPRequest($docID));
26
        $this->assertEquals($doc->getFullPath(), $result, 'Correct underlying file returned (in test mode)');
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
27
28
        $doc->embargoIndefinitely();
29
30
        $this->logInWithPermission('ADMIN');
31
        $result = $controller->index($this->createFakeHTTPRequest($docID));
32
        $this->assertEquals($doc->getFullPath(), $result, 'Admins can still download embargoed files');
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
33
34
        $this->logInWithPermission('random-user-group');
35
        $result = $controller->index($this->createFakeHTTPRequest($docID));
36
        $this->assertNotEquals(
0 ignored issues
show
Bug introduced by
The method assertNotEquals() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
37
            $doc->getFullPath(),
38
            $result,
39
            'File no longer returned (in test mode) when switching to other user group'
40
        );
41
42
        DMSDocument_Controller::$testMode = $oldTestMode;
43
        DMSFilesystemTestHelper::delete('assets/_unit-test-123');
44
    }
45
46
    public function testEmbargoIndefinitely()
47
    {
48
        $doc = new DMSDocument();
49
        $doc->Filename = "DMS-test-lorum-file.pdf";
50
        $doc->Folder = "tests";
51
        $doc->write();
52
53
        $doc->embargoIndefinitely();
54
        $this->assertTrue($doc->isHidden(), "Document is hidden");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
55
        $this->assertTrue($doc->isEmbargoed(), "Document is embargoed");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
56
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
57
58
        $doc->clearEmbargo();
59
        $this->assertFalse($doc->isHidden(), "Document is not hidden");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
60
        $this->assertFalse($doc->isEmbargoed(), "Document is not embargoed");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
61
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
62
    }
63
64 View Code Duplication
    public function testExpireAtDate()
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...
65
    {
66
        $doc = new DMSDocument();
67
        $doc->Filename = "DMS-test-lorum-file.pdf";
68
        $doc->Folder = "tests";
69
        $doc->write();
70
71
        $doc->expireAtDate(strtotime('-1 second'));
72
        $this->assertTrue($doc->isHidden(), "Document is hidden");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
73
        $this->assertFalse($doc->isEmbargoed(), "Document is not embargoed");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
74
        $this->assertTrue($doc->isExpired(), "Document is expired");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
75
76
        $expireTime = "2069-12-12 17:10:13";
77
        $doc->expireAtDate($expireTime);
78
        $this->assertFalse($doc->isHidden(), "Document is not hidden");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
79
        $this->assertFalse($doc->isEmbargoed(), "Document is not embargoed");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
80
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
81
82
        SS_Datetime::set_mock_now($expireTime);
83
        $this->assertTrue($doc->isHidden(), "Document is hidden");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
84
        $this->assertFalse($doc->isEmbargoed(), "Document is not embargoed");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
85
        $this->assertTrue($doc->isExpired(), "Document is expired");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
86
        SS_Datetime::clear_mock_now();
87
88
        $doc->expireAtDate(strtotime('-1 second'));
89
        $this->assertTrue($doc->isHidden(), "Document is hidden");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
90
        $this->assertFalse($doc->isEmbargoed(), "Document is not embargoed");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
91
        $this->assertTrue($doc->isExpired(), "Document is expired");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
92
93
        $doc->clearExpiry();
94
        $this->assertFalse($doc->isHidden(), "Document is not hidden");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
95
        $this->assertFalse($doc->isEmbargoed(), "Document is not embargoed");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
96
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
97
    }
98
99 View Code Duplication
    public function testEmbargoUntilDate()
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...
100
    {
101
        $doc = new DMSDocument();
102
        $doc->Filename = "DMS-test-lorum-file.pdf";
103
        $doc->Folder = "tests";
104
        $doc->write();
105
106
        $doc->embargoUntilDate(strtotime('+1 minute'));
107
        $this->assertTrue($doc->isHidden(), "Document is hidden");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
108
        $this->assertTrue($doc->isEmbargoed(), "Document is embargoed");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
109
110
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
111
112
        $doc->embargoUntilDate(strtotime('-1 second'));
113
        $this->assertFalse($doc->isHidden(), "Document is not hidden");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
114
        $this->assertFalse($doc->isEmbargoed(), "Document is not embargoed");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
115
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
116
117
        $embargoTime = "2069-12-12 17:10:13";
118
        $doc->embargoUntilDate($embargoTime);
119
        $this->assertTrue($doc->isHidden(), "Document is hidden");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
120
        $this->assertTrue($doc->isEmbargoed(), "Document is embargoed");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
121
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
122
123
        SS_Datetime::set_mock_now($embargoTime);
124
        $this->assertFalse($doc->isHidden(), "Document is not hidden");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
125
        $this->assertFalse($doc->isEmbargoed(), "Document is not embargoed");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
126
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
127
128
        SS_Datetime::clear_mock_now();
129
130
        $doc->clearEmbargo();
131
        $this->assertFalse($doc->isHidden(), "Document is not hidden");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
132
        $this->assertFalse($doc->isEmbargoed(), "Document is not embargoed");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
133
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
134
    }
135
136
    public function testEmbargoUntilPublished()
137
    {
138
        $s1 = $this->objFromFixture('SiteTree', 's1');
139
140
        $doc = new DMSDocument();
141
        $doc->Filename = "test file";
142
        $doc->Folder = "0";
143
        $dID = $doc->write();
144
145
        $s1->getDocumentSets()->first()->getDocuments()->add($doc);
146
147
        $s1->publish('Stage', 'Live');
148
        $s1->doPublish();
149
        $this->assertFalse($doc->isHidden(), "Document is not hidden");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
150
        $this->assertFalse($doc->isEmbargoed(), "Document is not embargoed");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
151
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
152
153
        $doc->embargoUntilPublished();
154
        $this->assertTrue($doc->isHidden(), "Document is hidden");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
155
        $this->assertTrue($doc->isEmbargoed(), "Document is embargoed");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
156
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
157
158
        $s1->publish('Stage', 'Live');
159
        $s1->doPublish();
160
        $doc = DataObject::get_by_id("DMSDocument", $dID);
161
        $this->assertFalse($doc->isHidden(), "Document is not hidden");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
162
        $this->assertFalse($doc->isEmbargoed(), "Document is not embargoed");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
163
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
164
165
        $doc->embargoUntilPublished();
166
        $doc = DataObject::get_by_id("DMSDocument", $dID);
167
        $this->assertTrue($doc->isHidden(), "Document is hidden");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
168
        $this->assertTrue($doc->isEmbargoed(), "Document is embargoed");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
169
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
170
171
        $doc->embargoIndefinitely();
172
        $doc = DataObject::get_by_id("DMSDocument", $dID);
173
        $this->assertTrue($doc->isHidden(), "Document is hidden");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
174
        $this->assertTrue($doc->isEmbargoed(), "Document is embargoed");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
175
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
176
177
        $s1->publish('Stage', 'Live');
178
        $s1->doPublish();
179
        $doc = DataObject::get_by_id("DMSDocument", $dID);
180
        $this->assertTrue(
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
181
            $doc->isHidden(),
182
            "Document is still hidden because although the untilPublish flag is cleared, the indefinitely flag is there"
183
        );
184
        $this->assertTrue($doc->isEmbargoed(), "Document is embargoed");
0 ignored issues
show
Bug introduced by
The method assertTrue() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
185
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
186
187
        $doc->clearEmbargo();
188
        $doc = DataObject::get_by_id("DMSDocument", $dID);
189
        $this->assertFalse($doc->isHidden(), "Document is not hidden");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
190
        $this->assertFalse($doc->isEmbargoed(), "Document is not embargoed");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
191
        $this->assertFalse($doc->isExpired(), "Document is not expired");
0 ignored issues
show
Bug introduced by
The method assertFalse() does not seem to exist on object<DMSEmbargoTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
192
    }
193
}
194