1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109:
<?php
namespace Nethgui\Test\Unit\Nethgui\Renderer;
class HttpCommandReceiverTest extends \PHPUnit_Framework_TestCase
{
protected $object;
private $urlPrefix;
protected function setUp()
{
$moduleMock = $this->getMockBuilder('\Nethgui\Module\ModuleInterface')
->getMock();
$moduleMock->expects($this->any())
->method('getIdentifier')
->will($this->returnValue('ModuleId'));
$moduleMock->expects($this->any())
->method('getParent')
->will($this->returnValue(NULL));
$view = new \Nethgui\View\View(0, $moduleMock, $this->getMock('Nethgui\View\Translator', array(), array(), '', FALSE), array('http://localhost:8080', '/my', 'test.php'));
$delegatedCommandReceiver = $this->getMockBuilder('\Nethgui\View\CommandReceiverInterface')
->setMethods(array('executeCommand'))
->getMock();
$this->object = new \Nethgui\Renderer\HttpCommandReceiver($view, $delegatedCommandReceiver);
$this->urlPrefix = 'http://localhost:8080/my/test.php';
}
public function testShow()
{
$this->markTestIncomplete();
}
public function testHttpHeader()
{
$this->markTestIncomplete();
}
public function testGetHttpHeaders()
{
$this->markTestIncomplete();
}
public function testHasRefresh()
{
$this->markTestIncomplete();
}
public function testHasLocation()
{
$this->markTestIncomplete();
}
public function testReloadData()
{
$this->markTestIncomplete();
}
public function testSendQuery()
{
$this->markTestIncomplete();
}
private function getGlobalMock($url)
{
$mock = $this->getMockBuilder('\Nethgui\Utility\PhpWrapper')
->setMethods(array('header', 'ob_get_status', 'ob_end_clean', 'phpExit'))
->getMock();
$mock->expects($this->at(0))
->method('header')
->with(new \PHPUnit_Framework_Constraint_StringStartsWith('HTTP/1.1 302'));
$mock->expects($this->at(1))
->method('header')
->with('Location: ' . $url);
$mock->expects($this->once())
->method('ob_get_status')
->will($this->returnValue(array('dummy')));
$mock->expects($this->once())
->method('ob_end_clean');
$mock->expects($this->once())
->method('phpExit');
return $mock;
}
}