object = new Publisher(); } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ protected function tearDown() { } /** * This is the default method to test, if the class still having * the same number of methods. */ public function testNumberOfMethodsInThisClass() { $methods = get_class_methods('Publisher'); $this->assertTrue( count($methods) == 3); } /** * @covers Publisher::AddContent * @todo Implement testAddContent(). */ public function testAddContent() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('AddContent', $methods ), 'exists method AddContent' ); $r = new ReflectionMethod('Publisher', 'AddContent'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'strType'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == true); $this->assertTrue( $params[0]->getDefaultValue() == 'form'); $this->assertTrue( $params[1]->getName() == 'strLayout'); $this->assertTrue( $params[1]->isArray() == false); $this->assertTrue( $params[1]->isOptional () == true); $this->assertTrue( $params[1]->getDefaultValue() == 'form'); $this->assertTrue( $params[2]->getName() == 'strName'); $this->assertTrue( $params[2]->isArray() == false); $this->assertTrue( $params[2]->isOptional () == true); $this->assertTrue( $params[2]->getDefaultValue() == ''); $this->assertTrue( $params[3]->getName() == 'strContent'); $this->assertTrue( $params[3]->isArray() == false); $this->assertTrue( $params[3]->isOptional () == true); $this->assertTrue( $params[3]->getDefaultValue() == ''); $this->assertTrue( $params[4]->getName() == 'arrData'); $this->assertTrue( $params[4]->isArray() == false); $this->assertTrue( $params[4]->isOptional () == true); $this->assertTrue( $params[4]->getDefaultValue() == ''); $this->assertTrue( $params[5]->getName() == 'strTarget'); $this->assertTrue( $params[5]->isArray() == false); $this->assertTrue( $params[5]->isOptional () == true); $this->assertTrue( $params[5]->getDefaultValue() == ''); $this->assertTrue( $params[6]->getName() == 'ajaxServer'); $this->assertTrue( $params[6]->isArray() == false); $this->assertTrue( $params[6]->isOptional () == true); $this->assertTrue( $params[6]->getDefaultValue() == ''); $this->assertTrue( $params[7]->getName() == 'mode'); $this->assertTrue( $params[7]->isArray() == false); $this->assertTrue( $params[7]->isOptional () == true); $this->assertTrue( $params[7]->getDefaultValue() == ''); $this->assertTrue( $params[8]->getName() == 'bAbsolutePath'); $this->assertTrue( $params[8]->isArray() == false); $this->assertTrue( $params[8]->isOptional () == true); $this->assertTrue( $params[8]->getDefaultValue() == ''); } /** * @covers Publisher::RenderContent * @todo Implement testRenderContent(). */ public function testRenderContent() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('RenderContent', $methods ), 'exists method RenderContent' ); $r = new ReflectionMethod('Publisher', 'RenderContent'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'intPos'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == true); $this->assertTrue( $params[0]->getDefaultValue() == '0'); } /** * @covers Publisher::RenderContent0 * @todo Implement testRenderContent0(). */ public function testRenderContent0() { $methods = get_class_methods($this->object); $this->assertTrue( in_array('RenderContent0', $methods ), 'exists method RenderContent0' ); $r = new ReflectionMethod('Publisher', 'RenderContent0'); $params = $r->getParameters(); $this->assertTrue( $params[0]->getName() == 'intPos'); $this->assertTrue( $params[0]->isArray() == false); $this->assertTrue( $params[0]->isOptional () == true); $this->assertTrue( $params[0]->getDefaultValue() == '0'); $this->assertTrue( $params[1]->getName() == 'showXMLFormName'); $this->assertTrue( $params[1]->isArray() == false); $this->assertTrue( $params[1]->isOptional () == true); $this->assertTrue( $params[1]->getDefaultValue() == ''); } }