public function testGetArea() { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\State')->setAreaCode('frontend'); $this->assertEquals('frontend', $this->_block->getArea()); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\State')->setAreaCode('some_area'); $this->assertEquals('some_area', $this->_block->getArea()); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\State')->setAreaCode('another_area'); $this->assertEquals('another_area', $this->_block->getArea()); }