get('Magento\Framework\App\State')->setAreaCode('frontend'); $this->_block = $objectManager->get( 'Magento\Framework\View\LayoutInterface' )->createBlock( 'Magento\Customer\Block\Widget\Gender' ); } /** * Test the Gender::getGenderOptions() method. * @return void */ public function testGetGenderOptions() { $options = $this->_block->getGenderOptions(); $this->assertInternalType('array', $options); $this->assertNotEmpty($options); $this->assertContainsOnlyInstancesOf('Magento\Customer\Model\Data\Option', $options); } /** * Test the Gender::toHtml() method. * @return void */ public function testToHtml() { $html = $this->_block->toHtml(); $this->assertContains('Gender', $html); $this->assertContains('', $html); $this->assertContains('', $html); $this->assertContains('', $html); } }