Skip to content

Commit

Permalink
Fix file submissions in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Mooyman committed Oct 4, 2017
1 parent 9a02810 commit dc29a78
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/php/Controller/AssetAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ public function testItRestrictsCreateFileOnExtension()

public function testItRestrictsUpdateFile()
{
/** @var File $allowedFile */
$allowedFile = $this->objFromFixture(File::class, 'file1');
/** @var File $disallowedFile */
$disallowedFile = $this->objFromFixture(File::class, 'disallowCanEdit');

$response = Director::test(
Expand All @@ -228,6 +230,10 @@ public function testItRestrictsUpdateFile()
'Name' => 'disallowCanEdit.txt',
'Title' => 'new',
'SecurityID' => SecurityToken::inst()->getValue(),
'CanViewType' => $allowedFile->CanViewType,
'ViewerGroups' => 'unchanged',
'CanEditType' => $allowedFile->CanEditType,
'EditorGroups' => 'unchanged',
],
$this->session
);
Expand All @@ -240,6 +246,10 @@ public function testItRestrictsUpdateFile()
'ID' => $disallowedFile->ID,
'Title' => 'new',
'SecurityID' => SecurityToken::inst()->getValue(),
'CanViewType' => $disallowedFile->CanViewType,
'ViewerGroups' => 'unchanged',
'CanEditType' => $disallowedFile->CanEditType,
'EditorGroups' => 'unchanged',
],
$this->session
);
Expand Down Expand Up @@ -281,6 +291,10 @@ public function testSaveOrPublish()
'action_save' => 1,
'Name' => 'folder1-renamed',
'SecurityID' => SecurityToken::inst()->getValue(),
'CanViewType' => 'Inherit',
'ViewerGroups' => 'unchanged',
'CanEditType' => 'Inherit',
'EditorGroups' => 'unchanged',
]
);
$this->assertFalse($response->isError());
Expand Down

0 comments on commit dc29a78

Please sign in to comment.