diff --git tests/phpunit/tests/ajax/DeleteComment.php tests/phpunit/tests/ajax/DeleteComment.php
index 97a2c02..ee7d257 100644
|
|
class Tests_Ajax_DeleteComment extends WP_Ajax_UnitTestCase { |
26 | 26 | */ |
27 | 27 | public function setUp() { |
28 | 28 | parent::setUp(); |
| 29 | |
| 30 | // Turn off comment notifications for tests. |
| 31 | update_option( 'comments_notify', 0 ); |
| 32 | |
29 | 33 | $post_id = $this->factory->post->create(); |
30 | 34 | $this->_comments = $this->factory->comment->create_post_comments( $post_id, 15 ); |
31 | 35 | $this->_comments = array_map( 'get_comment', $this->_comments ); |
32 | 36 | } |
33 | 37 | |
34 | 38 | /** |
| 39 | * Reset default settings. |
| 40 | */ |
| 41 | public function tearDown() { |
| 42 | // Turn comment notifications back on. |
| 43 | update_option( 'comments_notify', 1 ); |
| 44 | } |
| 45 | |
| 46 | /** |
35 | 47 | * Clear the POST actions in between requests |
36 | 48 | */ |
37 | 49 | protected function _clear_post_action() { |
diff --git tests/phpunit/tests/ajax/DimComment.php tests/phpunit/tests/ajax/DimComment.php
index d34b64d..1bfe33c 100644
|
|
class Tests_Ajax_DimComment extends WP_Ajax_UnitTestCase { |
26 | 26 | */ |
27 | 27 | public function setUp() { |
28 | 28 | parent::setUp(); |
| 29 | |
| 30 | // Turn off comment notifications for tests. |
| 31 | update_option( 'comments_notify', 0 ); |
| 32 | |
29 | 33 | $post_id = $this->factory->post->create(); |
30 | 34 | $this->_comments = $this->factory->comment->create_post_comments( $post_id, 15 ); |
31 | 35 | $this->_comments = array_map( 'get_comment', $this->_comments ); |
32 | 36 | } |
33 | 37 | |
34 | 38 | /** |
| 39 | * Reset default settings. |
| 40 | */ |
| 41 | public function tearDown() { |
| 42 | // Turn comment notifications back on. |
| 43 | update_option( 'comments_notify', 1 ); |
| 44 | } |
| 45 | |
| 46 | /** |
35 | 47 | * Clear the POST actions in between requests |
36 | 48 | */ |
37 | 49 | protected function _clear_post_action() { |
diff --git tests/phpunit/tests/ajax/ReplytoComment.php tests/phpunit/tests/ajax/ReplytoComment.php
index 7935bc2..4cea72c 100644
|
|
class Tests_Ajax_ReplytoComment extends WP_Ajax_UnitTestCase { |
32 | 32 | */ |
33 | 33 | public function setUp() { |
34 | 34 | parent::setUp(); |
| 35 | |
| 36 | // Turn off comment notifications for tests. |
| 37 | update_option( 'comments_notify', 0 ); |
| 38 | |
35 | 39 | $post_id = $this->factory->post->create(); |
36 | 40 | $this->factory->comment->create_post_comments( $post_id, 5 ); |
37 | 41 | $this->_comment_post = get_post( $post_id ); |
… |
… |
class Tests_Ajax_ReplytoComment extends WP_Ajax_UnitTestCase { |
43 | 47 | } |
44 | 48 | |
45 | 49 | /** |
| 50 | * Reset default settings. |
| 51 | */ |
| 52 | public function tearDown() { |
| 53 | // Turn comment notifications back on. |
| 54 | update_option( 'comments_notify', 1 ); |
| 55 | } |
| 56 | |
| 57 | /** |
46 | 58 | * Reply as a privilged user (administrator) |
47 | 59 | * Expects test to pass |
48 | 60 | * @return void |