/** * @covers Xoops\Form\SelectCountry::render * @todo Implement testRender(). */ public function testRender() { $value = $this->object->render(); $this->assertTrue(is_string($value)); $this->assertTrue(false !== strpos($value, '<select')); $this->assertTrue(false !== strpos($value, 'name="name"')); $this->assertTrue(false !== strpos($value, 'size="1"')); $this->assertTrue(false !== strpos($value, 'title="Caption"')); $this->assertTrue(false !== strpos($value, 'id="name"')); $this->assertTrue(false !== strpos($value, '<option')); $this->assertTrue(false !== strpos($value, 'value="US"')); $this->assertTrue(false !== strpos($value, '</option>')); $this->assertTrue(false !== strpos($value, '</select>')); }
/** * @covers Xoops\Form\SelectCountry::__construct * @covers Xoops\Form\SelectCountry::render */ public function test__construct() { $oldWay = new SelectCountry('mycaption', 'myname', 'FR'); $newWay = new SelectCountry(['caption' => 'mycaption', 'name' => 'myname', 'value' => 'FR']); $this->assertEquals($oldWay->render(), $newWay->render()); }