-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OPUSVIER-3541 Fixed notification form for publication.
- Loading branch information
Showing
8 changed files
with
137 additions
and
70 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
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 |
---|---|---|
|
@@ -304,10 +304,7 @@ public function testSubmitterNotificationIsAvailable() | |
|
||
$this->assertContains('[email protected]', $body); | ||
$this->assertContains('[email protected]', $body); | ||
$this->assertContains( | ||
'<input type="checkbox" name="submitter" id="submitter" value="1" checked="checked"', | ||
$body | ||
); | ||
$this->assertXpath('//input[@type="checkbox" and @id="submitter" and @name="submitter" and @value="1" and @checked="checked"]'); | ||
} | ||
|
||
public function testAuthorNotificationIsAvailable() | ||
|
@@ -322,10 +319,7 @@ public function testAuthorNotificationIsAvailable() | |
|
||
$this->assertContains('[email protected]', $body); | ||
$this->assertContains('[email protected]', $body); | ||
$this->assertContains( | ||
'<input type="checkbox" name="author_1" id="author_1" value="1" checked="checked"', | ||
$body | ||
); | ||
$this->assertXpath('//input[@type="checkbox" and @id="author_0" and @name="author_0" and @value="1" and @checked="checked"]'); | ||
} | ||
|
||
public function testSubmitterNotificationIsNotAvailable() | ||
|
@@ -339,14 +333,8 @@ public function testSubmitterNotificationIsNotAvailable() | |
|
||
$this->assertNotContains('[email protected]', $body); | ||
$this->assertContains('[email protected]', $body); | ||
$this->assertContains( | ||
'<input type="checkbox" name="submitter" id="submitter" value="1" disabled="1"', | ||
$body | ||
); | ||
$this->assertContains( | ||
'<input type="checkbox" name="author_1" id="author_1" value="1" checked="checked"', | ||
$body | ||
); | ||
$this->assertXpath('//input[@type="checkbox" and @id="submitter" and @name="submitter" and @value="1" and @disabled="disabled"]'); | ||
$this->assertXpath('//input[@type="checkbox" and @id="author_0" and @name="author_0" and @value="1" and @checked="checked"]'); | ||
} | ||
|
||
public function testAuthorNotificationIsNotAvailable() | ||
|
@@ -360,14 +348,8 @@ public function testAuthorNotificationIsNotAvailable() | |
|
||
$this->assertContains('[email protected]', $body); | ||
$this->assertNotContains('[email protected]', $body); | ||
$this->assertContains( | ||
'<input type="checkbox" name="submitter" id="submitter" value="1" checked="checked"', | ||
$body | ||
); | ||
$this->assertContains( | ||
'<input type="checkbox" name="author_1" id="author_1" value="1" disabled="1"', | ||
$body | ||
); | ||
$this->assertXpath('//input[@type="checkbox" and @id="submitter" and @name="submitter" and @value="1" and @checked="checked"]'); | ||
$this->assertXpath('//input[@type="checkbox" and @id="author_0" and @name="author_0" and @value="1" and @disabled="disabled"]'); | ||
} | ||
|
||
public function testAuthorNotificationForMultipleAuthors() | ||
|
@@ -405,21 +387,11 @@ public function testAuthorNotificationForMultipleAuthors() | |
$this->assertContains('[email protected]', $body); | ||
$this->assertContains('[email protected]', $body); | ||
|
||
$this->assertContains( | ||
'<input type="checkbox" name="submitter" id="submitter" value="1" checked="checked"', $body | ||
); | ||
$this->assertContains( | ||
'<input type="checkbox" name="author_1" id="author_1" value="1" checked="checked"', $body | ||
); | ||
$this->assertContains( | ||
'<input type="checkbox" name="author_2" id="author_2" value="1" checked="checked"', $body | ||
); | ||
$this->assertContains( | ||
'<input type="checkbox" name="author_3" id="author_3" value="1" disabled="1"', $body | ||
); | ||
$this->assertContains( | ||
'<input type="checkbox" name="author_4" id="author_4" value="1" checked="checked"', $body | ||
); | ||
$this->assertXpath('//input[@type="checkbox" and @id="submitter" and @name="submitter" and @value="1" and @checked="checked"]'); | ||
$this->assertXpath('//input[@type="checkbox" and @id="author_0" and @name="author_0" and @value="1" and @checked="checked"]'); | ||
$this->assertXpath('//input[@type="checkbox" and @id="author_1" and @name="author_1" and @value="1" and @checked="checked"]'); | ||
$this->assertXpath('//input[@type="checkbox" and @id="author_2" and @name="author_2" and @value="1" and @disabled="disabled"]'); | ||
$this->assertXpath('//input[@type="checkbox" and @id="author_3" and @name="author_3" and @value="1" and @checked="checked"]'); | ||
} | ||
|
||
public function testShowDocInfoOnConfirmationPage() | ||
|
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 |
---|---|---|
|
@@ -86,7 +86,7 @@ public function testGetRecipients() | |
{ | ||
$this->setUpTestDocument(); | ||
|
||
$form = new Admin_Form_DocumentStateChange('published'); | ||
$form = new Admin_Form_WorkflowNotification('published'); | ||
|
||
$recipients = $form->getRecipients($this->doc); | ||
|
||
|
@@ -112,6 +112,28 @@ public function testGetRecipients() | |
], $recipients); | ||
} | ||
|
||
public function testGetSelectedRecipients() { | ||
$this->setUpTestDocument(); | ||
|
||
$form = new Admin_Form_WorkflowNotification('published'); | ||
|
||
$post = [ | ||
'sureyes' => 'Yes', | ||
'id' => 150, | ||
'submitter' => '1', | ||
'author_0' => '1', | ||
'author_1' => '1', | ||
'author_2' => '1' | ||
]; | ||
|
||
$recipients = $form->getSelectedRecipients($this->doc, $post); | ||
|
||
$this->assertCount(2, $recipients); | ||
$this->assertArrayHasKey('[email protected]', $recipients); | ||
$this->assertArrayHasKey('[email protected]', $recipients); | ||
|
||
// TODO check more expectations (array structure) | ||
} | ||
|
||
/* TODO integrate or delete | ||
* /** | ||
|