forked from ucfopen/Materia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ucfopen#1198 Now checking if a widget is publishable by a user instea…
…d of if a widget instance is publishable by a user. Changed tests to match.
- Loading branch information
1 parent
5310d30
commit ee4bc96
Showing
6 changed files
with
46 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* @group App | ||
* @group Widget | ||
* @group Materia | ||
*/ | ||
|
||
class Test_Widget extends \Basetest | ||
{ | ||
public function test_publishable_by() | ||
{ | ||
$widget = $this->make_disposable_widget('RestrictPublish', true); | ||
|
||
$student = $this->_as_student(); | ||
$output = $widget->publishable_by($student->id); | ||
$this->assertFalse($output); | ||
|
||
$author = $this->_as_author(); | ||
$output = $widget->publishable_by($author->id); | ||
$this->assertTrue($output); | ||
} | ||
} |