Yst_License_Manager_UnitTestCase

TestCase base class for convenience methods.

Defined (1)

The class is defined in the following location(s).

/vendor/yoast/license-manager/tests/framework/class-yst-license-manager-unit-test-case.php  
  1. class Yst_License_Manager_UnitTestCase extends WP_UnitTestCase { 
  2.  
  3. /** 
  4. * @param string $key 
  5. * @param mixed $value 
  6. */ 
  7. protected function set_post( $key, $value ) { 
  8. $_POST[$key] = $_REQUEST[$key] = addslashes( $value ); 
  9.  
  10. /** 
  11. * @param string $key 
  12. */ 
  13. protected function unset_post( $key ) { 
  14. unset( $_POST[$key], $_REQUEST[$key] ); 
  15.  
  16. /** 
  17. * Fake a request to the WP front page 
  18. */ 
  19. protected function go_to_home() { 
  20. $this->go_to( home_url( '/' ) ); 
  21.  
  22. /** 
  23. * @param string $string 
  24. * @param mixed $function 
  25. */ 
  26. protected function expectOutput( $string, $function = null ) { 
  27. $output = ob_get_contents(); 
  28. ob_clean(); 
  29. $this->assertEquals( $output, $string ); 
  30.