forked from wearerequired/digest
-
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.
- Loading branch information
1 parent
ca89083
commit 7295c02
Showing
2 changed files
with
47 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Required\Digest\Tests; | ||
|
||
use \WP_UnitTestCase; | ||
use \Required\Digest\Message\CoreUpdate as CoreUpdateMessage; | ||
|
||
class CoreUpdate extends WP_UnitTestCase { | ||
public function test_no_entries() { | ||
$message = new CoreUpdateMessage( array(), null, 'core_update_success' ); | ||
|
||
$this->assertSame( '', $message->get_message() ); | ||
} | ||
|
||
public function test_no_entries_failure() { | ||
$message = new CoreUpdateMessage( array(), null, 'core_update_failure' ); | ||
|
||
$this->assertSame( '', $message->get_message() ); | ||
} | ||
|
||
public function test_single_entry_success() { | ||
$message = new CoreUpdateMessage( | ||
array( | ||
'100.1.0' => time(), | ||
), | ||
null, | ||
'core_update_success' | ||
); | ||
|
||
$this->assertContains( 'has been updated automatically to WordPress 100.1.0', $message->get_message() ); | ||
} | ||
|
||
public function test_single_entry_failure() { | ||
$message = new CoreUpdateMessage( | ||
array( | ||
'100.1.0' => time(), | ||
), | ||
null, | ||
'core_update_failure' | ||
); | ||
|
||
$this->assertContains( 'Please update your site', $message->get_message() ); | ||
$this->assertContains( 'WordPress 100.1.0', $message->get_message() ); | ||
} | ||
} |