]> _ Git - couzy.git/blob
b4b3c20f4e6d93ccb8c34e3bab9903c5ed575ad3
[couzy.git] /
1 <?php
2
3 /**
4  * TestCase base class for convenience methods.
5  */
6 class Yst_License_Manager_UnitTestCase extends WP_UnitTestCase {
7
8         /**
9          * @param string $key
10          * @param mixed $value
11          */
12         protected function set_post( $key, $value ) {
13                 $_POST[$key] = $_REQUEST[$key] = addslashes( $value );
14         }
15
16         /**
17          * @param string $key
18          */
19         protected function unset_post( $key ) {
20                 unset( $_POST[$key], $_REQUEST[$key] );
21         }
22
23         /**
24          * Fake a request to the WP front page
25          */
26         protected function go_to_home() {
27                 $this->go_to( home_url( '/' ) );
28         }
29
30         /**
31          * @param string $string
32          * @param mixed $function
33          */
34         protected function expectOutput( $string, $function = null ) {
35                 $output = ob_get_contents();
36                 ob_clean();
37                 $this->assertEquals( $output, $string );
38         }
39
40 }