assertInstanceOf('rmrevin\yii\fontawesome\FA', new FA()); $this->assertInstanceOf('rmrevin\yii\fontawesome\FontAwesome', new FA()); $this->assertInstanceOf('rmrevin\yii\fontawesome\FontAwesome', new FontAwesome()); $Icon = FA::icon('cog'); $this->assertInstanceOf('rmrevin\yii\fontawesome\component\Icon', $Icon); $Stack = FA::stack(); $this->assertInstanceOf('rmrevin\yii\fontawesome\component\Stack', $Stack); } public function testStackOutput() { $this->assertEquals( (string)FA::stack(), '' ); $this->assertEquals( (string)FA::stack()->tag('div'), '
' ); $this->assertEquals( (string)FA::stack() ->icon('cog'), '' ); $this->assertEquals( (string)FA::stack() ->on('square-o'), '' ); $this->assertEquals( (string)FA::stack() ->icon('cog') ->on('square-o'), '' ); $this->assertEquals( (string)FA::stack(['data-role' => 'stack']) ->icon('cog', ['data-role' => 'icon',]) ->on('square-o', ['data-role' => 'background']), '' ); $this->assertEquals( (string)FA::stack() ->icon((new Icon('cog'))->spin()) ->on((new Icon('square-o'))->size(FA::SIZE_3X)), '' ); } public function testIconOutput() { $this->assertEquals(FA::icon('cog'), ''); $this->assertEquals(FA::icon('cog')->tag('span'), ''); $this->assertEquals(FA::icon('cog')->addCssClass('highlight'), ''); $this->assertEquals(FA::icon('cog')->inverse(), ''); $this->assertEquals(FA::icon('cog')->spin(), ''); $this->assertEquals(FA::icon('cog')->fixedWidth(), ''); $this->assertEquals(FA::icon('cog')->fixed_width(), ''); $this->assertEquals(FA::icon('cog')->ul(), ''); $this->assertEquals(FA::icon('cog')->li(), ''); $this->assertEquals(FA::icon('cog')->border(), ''); $this->assertEquals(FA::icon('cog')->pullLeft(), ''); $this->assertEquals(FA::icon('cog')->pull_left(), ''); $this->assertEquals(FA::icon('cog')->pullRight(), ''); $this->assertEquals(FA::icon('cog')->pull_right(), ''); $this->assertEquals(FA::icon('cog')->size(FA::SIZE_2X), ''); $this->assertEquals(FA::icon('cog')->size(FA::SIZE_3X), ''); $this->assertEquals(FA::icon('cog')->size(FA::SIZE_4X), ''); $this->assertEquals(FA::icon('cog')->size(FA::SIZE_5X), ''); $this->assertEquals(FA::icon('cog')->size(FA::SIZE_LARGE), ''); $this->assertEquals(FA::icon('cog')->rotate(FA::ROTATE_90), ''); $this->assertEquals(FA::icon('cog')->rotate(FA::ROTATE_180), ''); $this->assertEquals(FA::icon('cog')->rotate(FA::ROTATE_270), ''); $this->assertEquals(FA::icon('cog')->flip(FA::FLIP_HORIZONTAL), ''); $this->assertEquals(FA::icon('cog')->flip(FA::FLIP_VERTICAL), ''); } public function testGetConstants() { $this->assertNotEmpty(FA::getConstants(false)); $this->assertNotEmpty(FA::getConstants(true)); } public function testIconSizeException() { $this->setExpectedException( 'yii\base\InvalidConfigException', 'FA::size() - invalid value. Use one of the constants: FA::SIZE_LARGE, FA::SIZE_2X, FA::SIZE_3X, FA::SIZE_4X, FA::SIZE_5X.' ); FA::icon('cog') ->size('badvalue'); } public function testIconRotateException() { $this->setExpectedException( 'yii\base\InvalidConfigException', 'FA::rotate() - invalid value. Use one of the constants: FA::ROTATE_90, FA::ROTATE_180, FA::ROTATE_270.' ); FA::icon('cog') ->rotate('badvalue'); } public function testIconFlipException() { $this->setExpectedException( 'yii\base\InvalidConfigException', 'FA::flip() - invalid value. Use one of the constants: FA::FLIP_HORIZONTAL, FA::FLIP_VERTICAL.' ); FA::icon('cog') ->flip('badvalue'); } }