예제 #1
0
 /**
  * @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>'));
 }
예제 #2
0
 /**
  * @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());
 }