/**
  * Set up required mocks for Wordpress controller class
  */
 protected function setUp()
 {
     // Set up Wordpress instance mock
     $this->wordpress = $this->getWordpressMock();
     $this->wordpress->expects($this->any())->method('getContent')->will($this->returnValue('<html><body>My fake Wordpress content</body></html>'));
     $this->wordpress->initialize();
 }
예제 #2
0
 public function testGlobalVariables()
 {
     // When
     $this->wordpress->initialize();
     // Then
     $this->assertArrayHasKey('wp_test_global1', $GLOBALS);
     $this->assertArrayHasKey('wp_test_global2', $GLOBALS);
     $this->assertFalse(array_key_exists('wp_test_global3', $GLOBALS));
 }
 /**
  * Returns an exception when specified Wordpress directory is not found
  */
 public function testExceptionWhenDirectoryNotFound()
 {
     $this->setExpectedException('InvalidArgumentException');
     $wordpress = new Wordpress($this->getKernelMock(), '/a/path/that/does/not/exists');
     $wordpress->initialize();
 }