diff --git a/Alert/AlertInterface.php b/Alert/AlertInterface.php index 139e0ac2..6604b217 100644 --- a/Alert/AlertInterface.php +++ b/Alert/AlertInterface.php @@ -11,7 +11,7 @@ namespace WBW\Bundle\BootstrapBundle\Alert; -use WBW\Bundle\BootstrapBundle\BootstrapInterface; +use WBW\Bundle\BootstrapBundle\WBWBootstrapInterface; /** * Alert interface. @@ -26,56 +26,56 @@ interface AlertInterface { * * @var string */ - const ALERT_TYPE_DANGER = BootstrapInterface::BOOTSTRAP_DANGER; + const ALERT_TYPE_DANGER = WBWBootstrapInterface::BOOTSTRAP_DANGER; /** * Alert type "dark". * * @var string */ - const ALERT_TYPE_DARK = BootstrapInterface::BOOTSTRAP_DARK; + const ALERT_TYPE_DARK = WBWBootstrapInterface::BOOTSTRAP_DARK; /** * Alert type "info". * * @var string */ - const ALERT_TYPE_INFO = BootstrapInterface::BOOTSTRAP_INFO; + const ALERT_TYPE_INFO = WBWBootstrapInterface::BOOTSTRAP_INFO; /** * Alert type "light". * * @var string */ - const ALERT_TYPE_LIGHT = BootstrapInterface::BOOTSTRAP_LIGHT; + const ALERT_TYPE_LIGHT = WBWBootstrapInterface::BOOTSTRAP_LIGHT; /** * Alert type "primary". * * @var string */ - const ALERT_TYPE_PRIMARY = BootstrapInterface::BOOTSTRAP_PRIMARY; + const ALERT_TYPE_PRIMARY = WBWBootstrapInterface::BOOTSTRAP_PRIMARY; /** * Alert type "secondary". * * @var string */ - const ALERT_TYPE_SECONDARY = BootstrapInterface::BOOTSTRAP_SECONDARY; + const ALERT_TYPE_SECONDARY = WBWBootstrapInterface::BOOTSTRAP_SECONDARY; /** * Alert type "success". * * @var string */ - const ALERT_TYPE_SUCCESS = BootstrapInterface::BOOTSTRAP_SUCCESS; + const ALERT_TYPE_SUCCESS = WBWBootstrapInterface::BOOTSTRAP_SUCCESS; /** * Alert type "warning". * * @var string */ - const ALERT_TYPE_WARNING = BootstrapInterface::BOOTSTRAP_WARNING; + const ALERT_TYPE_WARNING = WBWBootstrapInterface::BOOTSTRAP_WARNING; /** * Get the content. diff --git a/Badge/BadgeInterface.php b/Badge/BadgeInterface.php index e0b360c1..80e0364e 100644 --- a/Badge/BadgeInterface.php +++ b/Badge/BadgeInterface.php @@ -11,7 +11,7 @@ namespace WBW\Bundle\BootstrapBundle\Badge; -use WBW\Bundle\BootstrapBundle\BootstrapInterface; +use WBW\Bundle\BootstrapBundle\WBWBootstrapInterface; /** * Badge interface. @@ -26,56 +26,56 @@ interface BadgeInterface { * * @var string */ - const BADGE_TYPE_DANGER = BootstrapInterface::BOOTSTRAP_DANGER; + const BADGE_TYPE_DANGER = WBWBootstrapInterface::BOOTSTRAP_DANGER; /** * Badge type "dark". * * @var string */ - const BADGE_TYPE_DARK = BootstrapInterface::BOOTSTRAP_DARK; + const BADGE_TYPE_DARK = WBWBootstrapInterface::BOOTSTRAP_DARK; /** * Badge type "info". * * @var string */ - const BADGE_TYPE_INFO = BootstrapInterface::BOOTSTRAP_INFO; + const BADGE_TYPE_INFO = WBWBootstrapInterface::BOOTSTRAP_INFO; /** * Badge type "light". * * @var string */ - const BADGE_TYPE_LIGHT = BootstrapInterface::BOOTSTRAP_LIGHT; + const BADGE_TYPE_LIGHT = WBWBootstrapInterface::BOOTSTRAP_LIGHT; /** * Badge type "primary". * * @var string */ - const BADGE_TYPE_PRIMARY = BootstrapInterface::BOOTSTRAP_PRIMARY; + const BADGE_TYPE_PRIMARY = WBWBootstrapInterface::BOOTSTRAP_PRIMARY; /** * Badge type "secondary". * * @var string */ - const BADGE_TYPE_SECONDARY = BootstrapInterface::BOOTSTRAP_SECONDARY; + const BADGE_TYPE_SECONDARY = WBWBootstrapInterface::BOOTSTRAP_SECONDARY; /** * Badge type "success". * * @var string */ - const BADGE_TYPE_SUCCESS = BootstrapInterface::BOOTSTRAP_SUCCESS; + const BADGE_TYPE_SUCCESS = WBWBootstrapInterface::BOOTSTRAP_SUCCESS; /** * Badge type "warning". * * @var string */ - const BADGE_TYPE_WARNING = BootstrapInterface::BOOTSTRAP_WARNING; + const BADGE_TYPE_WARNING = WBWBootstrapInterface::BOOTSTRAP_WARNING; /** * Get the content. diff --git a/BootstrapInterface.php b/BootstrapInterface.php index 2e0db69e..18342032 100644 --- a/BootstrapInterface.php +++ b/BootstrapInterface.php @@ -16,6 +16,7 @@ * * @author webeweb * @package WBW\Bundle\BootstrapBundle + * @deprecated since 3.5.0, use {@see WBW\Bundle\BootstrapBundle\BootstrapInterface} */ interface BootstrapInterface { @@ -24,75 +25,75 @@ interface BootstrapInterface { * * @var string */ - const BOOTSTRAP_DANGER = "danger"; + const BOOTSTRAP_DANGER = WBWBootstrapInterface::BOOTSTRAP_DANGER; /** * Bootstrap "dark". * * @var string */ - const BOOTSTRAP_DARK = "dark"; + const BOOTSTRAP_DARK = WBWBootstrapInterface::BOOTSTRAP_DARK; /** * Bootstrap "default". * * @var string */ - const BOOTSTRAP_DEFAULT = "default"; + const BOOTSTRAP_DEFAULT = WBWBootstrapInterface::BOOTSTRAP_DEFAULT; /** * Bootstrap "info". * * @var string */ - const BOOTSTRAP_INFO = "info"; + const BOOTSTRAP_INFO = WBWBootstrapInterface::BOOTSTRAP_INFO; /** * Bootstrap "light". * * @var string */ - const BOOTSTRAP_LIGHT = "light"; + const BOOTSTRAP_LIGHT = WBWBootstrapInterface::BOOTSTRAP_LIGHT; /** * Bootstrap "primary". * * @var string */ - const BOOTSTRAP_PRIMARY = "primary"; + const BOOTSTRAP_PRIMARY = WBWBootstrapInterface::BOOTSTRAP_PRIMARY; /** * Bootstrap "secondary". * * @var string */ - const BOOTSTRAP_SECONDARY = "secondary"; + const BOOTSTRAP_SECONDARY = WBWBootstrapInterface::BOOTSTRAP_SECONDARY; /** * Bootstrap "success". * * @var string */ - const BOOTSTRAP_SUCCESS = "success"; + const BOOTSTRAP_SUCCESS = WBWBootstrapInterface::BOOTSTRAP_SUCCESS; /** * Bootstrap version 3. * * @var string */ - const BOOTSTRAP_VERSION_3 = "3.4.1"; + const BOOTSTRAP_VERSION_3 = WBWBootstrapInterface::BOOTSTRAP_VERSION_3; /** * Bootstrap version 4. * * @var string */ - const BOOTSTRAP_VERSION_4 = "4.3.1"; + const BOOTSTRAP_VERSION_4 = WBWBootstrapInterface::BOOTSTRAP_VERSION_4; /** * Bootstrap "warning". * * @var string */ - const BOOTSTRAP_WARNING = "warning"; + const BOOTSTRAP_WARNING = WBWBootstrapInterface::BOOTSTRAP_WARNING; } diff --git a/Button/ButtonInterface.php b/Button/ButtonInterface.php index 1c11cd5f..539d9433 100644 --- a/Button/ButtonInterface.php +++ b/Button/ButtonInterface.php @@ -11,7 +11,7 @@ namespace WBW\Bundle\BootstrapBundle\Button; -use WBW\Bundle\BootstrapBundle\BootstrapInterface; +use WBW\Bundle\BootstrapBundle\WBWBootstrapInterface; /** * Button interface. @@ -47,35 +47,35 @@ interface ButtonInterface { * * @var string */ - const BUTTON_TYPE_DANGER = BootstrapInterface::BOOTSTRAP_DANGER; + const BUTTON_TYPE_DANGER = WBWBootstrapInterface::BOOTSTRAP_DANGER; /** * Button type "dark". * * @var string */ - const BUTTON_TYPE_DARK = BootstrapInterface::BOOTSTRAP_DARK; + const BUTTON_TYPE_DARK = WBWBootstrapInterface::BOOTSTRAP_DARK; /** * Button type "default". * * @var string */ - const BUTTON_TYPE_DEFAULT = BootstrapInterface::BOOTSTRAP_DEFAULT; + const BUTTON_TYPE_DEFAULT = WBWBootstrapInterface::BOOTSTRAP_DEFAULT; /** * Button type "info". * * @var string */ - const BUTTON_TYPE_INFO = BootstrapInterface::BOOTSTRAP_INFO; + const BUTTON_TYPE_INFO = WBWBootstrapInterface::BOOTSTRAP_INFO; /** * Button type "light". * * @var string */ - const BUTTON_TYPE_LIGHT = BootstrapInterface::BOOTSTRAP_LIGHT; + const BUTTON_TYPE_LIGHT = WBWBootstrapInterface::BOOTSTRAP_LIGHT; /** * Button type "link". @@ -89,25 +89,25 @@ interface ButtonInterface { * * @var string */ - const BUTTON_TYPE_PRIMARY = BootstrapInterface::BOOTSTRAP_PRIMARY; + const BUTTON_TYPE_PRIMARY = WBWBootstrapInterface::BOOTSTRAP_PRIMARY; /** * Button type "secondary". * * @var string */ - const BUTTON_TYPE_SECONDARY = BootstrapInterface::BOOTSTRAP_SECONDARY; + const BUTTON_TYPE_SECONDARY = WBWBootstrapInterface::BOOTSTRAP_SECONDARY; /** * Button type "success". * * @var string */ - const BUTTON_TYPE_SUCCESS = BootstrapInterface::BOOTSTRAP_SUCCESS; + const BUTTON_TYPE_SUCCESS = WBWBootstrapInterface::BOOTSTRAP_SUCCESS; /** * Button type "warning". * * @var string */ - const BUTTON_TYPE_WARNING = BootstrapInterface::BOOTSTRAP_WARNING; + const BUTTON_TYPE_WARNING = WBWBootstrapInterface::BOOTSTRAP_WARNING; /** * Get the active. diff --git a/ProgressBar/ProgressBarInterface.php b/ProgressBar/ProgressBarInterface.php index 84fc30fa..87eb9eb3 100644 --- a/ProgressBar/ProgressBarInterface.php +++ b/ProgressBar/ProgressBarInterface.php @@ -11,7 +11,7 @@ namespace WBW\Bundle\BootstrapBundle\ProgressBar; -use WBW\Bundle\BootstrapBundle\BootstrapInterface; +use WBW\Bundle\BootstrapBundle\WBWBootstrapInterface; /** * Progress bar interface. @@ -26,28 +26,28 @@ interface ProgressBarInterface { * * @var string */ - const PROGRESS_BAR_TYPE_DANGER = BootstrapInterface::BOOTSTRAP_DANGER; + const PROGRESS_BAR_TYPE_DANGER = WBWBootstrapInterface::BOOTSTRAP_DANGER; /** * Progress bar type "info". * * @var string */ - const PROGRESS_BAR_TYPE_INFO = BootstrapInterface::BOOTSTRAP_INFO; + const PROGRESS_BAR_TYPE_INFO = WBWBootstrapInterface::BOOTSTRAP_INFO; /** * Progress bar type "success". * * @var string */ - const PROGRESS_BAR_TYPE_SUCCESS = BootstrapInterface::BOOTSTRAP_SUCCESS; + const PROGRESS_BAR_TYPE_SUCCESS = WBWBootstrapInterface::BOOTSTRAP_SUCCESS; /** * Progress bar type "warning". * * @var string */ - const PROGRESS_BAR_TYPE_WARNING = BootstrapInterface::BOOTSTRAP_WARNING; + const PROGRESS_BAR_TYPE_WARNING = WBWBootstrapInterface::BOOTSTRAP_WARNING; /** * Get the animated. diff --git a/Tests/Alert/AlertInterfaceTest.php b/Tests/Alert/AlertInterfaceTest.php index 996d2c27..ef8ecbd2 100644 --- a/Tests/Alert/AlertInterfaceTest.php +++ b/Tests/Alert/AlertInterfaceTest.php @@ -12,7 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Tests\Alert; use WBW\Bundle\BootstrapBundle\Alert\AlertInterface; -use WBW\Bundle\BootstrapBundle\BootstrapInterface; +use WBW\Bundle\BootstrapBundle\WBWBootstrapInterface; use WBW\Bundle\BootstrapBundle\Tests\AbstractTestCase; /** @@ -30,13 +30,13 @@ class AlertInterfaceTest extends AbstractTestCase { */ public function testConstruct() { - $this->assertEquals(BootstrapInterface::BOOTSTRAP_DANGER, AlertInterface::ALERT_TYPE_DANGER); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_DARK, AlertInterface::ALERT_TYPE_DARK); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_INFO, AlertInterface::ALERT_TYPE_INFO); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_LIGHT, AlertInterface::ALERT_TYPE_LIGHT); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_PRIMARY, AlertInterface::ALERT_TYPE_PRIMARY); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_SECONDARY, AlertInterface::ALERT_TYPE_SECONDARY); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_SUCCESS, AlertInterface::ALERT_TYPE_SUCCESS); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_WARNING, AlertInterface::ALERT_TYPE_WARNING); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_DANGER, AlertInterface::ALERT_TYPE_DANGER); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_DARK, AlertInterface::ALERT_TYPE_DARK); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_INFO, AlertInterface::ALERT_TYPE_INFO); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_LIGHT, AlertInterface::ALERT_TYPE_LIGHT); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_PRIMARY, AlertInterface::ALERT_TYPE_PRIMARY); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_SECONDARY, AlertInterface::ALERT_TYPE_SECONDARY); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_SUCCESS, AlertInterface::ALERT_TYPE_SUCCESS); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_WARNING, AlertInterface::ALERT_TYPE_WARNING); } } diff --git a/Tests/Badge/BadgeInterfaceTest.php b/Tests/Badge/BadgeInterfaceTest.php index 8162ab2b..257c1b79 100644 --- a/Tests/Badge/BadgeInterfaceTest.php +++ b/Tests/Badge/BadgeInterfaceTest.php @@ -12,7 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Tests\Badge; use WBW\Bundle\BootstrapBundle\Badge\BadgeInterface; -use WBW\Bundle\BootstrapBundle\BootstrapInterface; +use WBW\Bundle\BootstrapBundle\WBWBootstrapInterface; use WBW\Bundle\BootstrapBundle\Tests\AbstractTestCase; /** @@ -30,13 +30,13 @@ class BadgeInterfaceTest extends AbstractTestCase { */ public function testConstruct() { - $this->assertEquals(BootstrapInterface::BOOTSTRAP_DANGER, BadgeInterface::BADGE_TYPE_DANGER); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_DARK, BadgeInterface::BADGE_TYPE_DARK); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_INFO, BadgeInterface::BADGE_TYPE_INFO); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_LIGHT, BadgeInterface::BADGE_TYPE_LIGHT); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_PRIMARY, BadgeInterface::BADGE_TYPE_PRIMARY); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_SECONDARY, BadgeInterface::BADGE_TYPE_SECONDARY); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_SUCCESS, BadgeInterface::BADGE_TYPE_SUCCESS); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_WARNING, BadgeInterface::BADGE_TYPE_WARNING); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_DANGER, BadgeInterface::BADGE_TYPE_DANGER); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_DARK, BadgeInterface::BADGE_TYPE_DARK); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_INFO, BadgeInterface::BADGE_TYPE_INFO); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_LIGHT, BadgeInterface::BADGE_TYPE_LIGHT); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_PRIMARY, BadgeInterface::BADGE_TYPE_PRIMARY); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_SECONDARY, BadgeInterface::BADGE_TYPE_SECONDARY); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_SUCCESS, BadgeInterface::BADGE_TYPE_SUCCESS); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_WARNING, BadgeInterface::BADGE_TYPE_WARNING); } } diff --git a/Tests/BootstrapInterfaceTest.php b/Tests/BootstrapInterfaceTest.php index 76c9e3fe..ed4ac878 100644 --- a/Tests/BootstrapInterfaceTest.php +++ b/Tests/BootstrapInterfaceTest.php @@ -12,6 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Tests; use WBW\Bundle\BootstrapBundle\BootstrapInterface; +use WBW\Bundle\BootstrapBundle\WBWBootstrapInterface; /** * Bootstrap interface test. @@ -28,17 +29,17 @@ class BootstrapInterfaceTest extends AbstractTestCase { */ public function testConstruct() { - $this->assertEquals("3.4.1", BootstrapInterface::BOOTSTRAP_VERSION_3); - $this->assertEquals("4.3.1", BootstrapInterface::BOOTSTRAP_VERSION_4); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_VERSION_3, BootstrapInterface::BOOTSTRAP_VERSION_3); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_VERSION_4, BootstrapInterface::BOOTSTRAP_VERSION_4); - $this->assertEquals("danger", BootstrapInterface::BOOTSTRAP_DANGER); - $this->assertEquals("dark", BootstrapInterface::BOOTSTRAP_DARK); - $this->assertEquals("default", BootstrapInterface::BOOTSTRAP_DEFAULT); - $this->assertEquals("info", BootstrapInterface::BOOTSTRAP_INFO); - $this->assertEquals("light", BootstrapInterface::BOOTSTRAP_LIGHT); - $this->assertEquals("primary", BootstrapInterface::BOOTSTRAP_PRIMARY); - $this->assertEquals("secondary", BootstrapInterface::BOOTSTRAP_SECONDARY); - $this->assertEquals("success", BootstrapInterface::BOOTSTRAP_SUCCESS); - $this->assertEquals("warning", BootstrapInterface::BOOTSTRAP_WARNING); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_DANGER, BootstrapInterface::BOOTSTRAP_DANGER); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_DARK, BootstrapInterface::BOOTSTRAP_DARK); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_DEFAULT, BootstrapInterface::BOOTSTRAP_DEFAULT); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_INFO, BootstrapInterface::BOOTSTRAP_INFO); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_LIGHT, BootstrapInterface::BOOTSTRAP_LIGHT); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_PRIMARY, BootstrapInterface::BOOTSTRAP_PRIMARY); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_SECONDARY, BootstrapInterface::BOOTSTRAP_SECONDARY); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_SUCCESS, BootstrapInterface::BOOTSTRAP_SUCCESS); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_WARNING, BootstrapInterface::BOOTSTRAP_WARNING); } } diff --git a/Tests/Button/ButtonInterfaceTest.php b/Tests/Button/ButtonInterfaceTest.php index 697caf11..4f603806 100644 --- a/Tests/Button/ButtonInterfaceTest.php +++ b/Tests/Button/ButtonInterfaceTest.php @@ -11,7 +11,7 @@ namespace WBW\Bundle\BootstrapBundle\Tests\Button; -use WBW\Bundle\BootstrapBundle\BootstrapInterface; +use WBW\Bundle\BootstrapBundle\WBWBootstrapInterface; use WBW\Bundle\BootstrapBundle\Button\ButtonInterface; use WBW\Bundle\BootstrapBundle\Tests\AbstractTestCase; @@ -34,15 +34,15 @@ public function testConstruct() { $this->assertEquals("sm", ButtonInterface::BUTTON_SIZE_SM); $this->assertEquals("xs", ButtonInterface::BUTTON_SIZE_XS); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_DANGER, ButtonInterface::BUTTON_TYPE_DANGER); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_DARK, ButtonInterface::BUTTON_TYPE_DARK); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_DEFAULT, ButtonInterface::BUTTON_TYPE_DEFAULT); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_INFO, ButtonInterface::BUTTON_TYPE_INFO); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_LIGHT, ButtonInterface::BUTTON_TYPE_LIGHT); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_DANGER, ButtonInterface::BUTTON_TYPE_DANGER); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_DARK, ButtonInterface::BUTTON_TYPE_DARK); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_DEFAULT, ButtonInterface::BUTTON_TYPE_DEFAULT); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_INFO, ButtonInterface::BUTTON_TYPE_INFO); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_LIGHT, ButtonInterface::BUTTON_TYPE_LIGHT); $this->assertEquals("link", ButtonInterface::BUTTON_TYPE_LINK); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_PRIMARY, ButtonInterface::BUTTON_TYPE_PRIMARY); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_SECONDARY, ButtonInterface::BUTTON_TYPE_SECONDARY); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_SUCCESS, ButtonInterface::BUTTON_TYPE_SUCCESS); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_WARNING, ButtonInterface::BUTTON_TYPE_WARNING); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_PRIMARY, ButtonInterface::BUTTON_TYPE_PRIMARY); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_SECONDARY, ButtonInterface::BUTTON_TYPE_SECONDARY); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_SUCCESS, ButtonInterface::BUTTON_TYPE_SUCCESS); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_WARNING, ButtonInterface::BUTTON_TYPE_WARNING); } } diff --git a/Tests/Controller/LayoutControllerTest.php b/Tests/Controller/LayoutControllerTest.php index c14d6e1d..98f78b2f 100644 --- a/Tests/Controller/LayoutControllerTest.php +++ b/Tests/Controller/LayoutControllerTest.php @@ -11,7 +11,7 @@ namespace WBW\Bundle\BootstrapBundle\Tests\Controller; -use WBW\Bundle\BootstrapBundle\BootstrapInterface; +use WBW\Bundle\BootstrapBundle\WBWBootstrapInterface; use WBW\Bundle\BootstrapBundle\Tests\AbstractWebTestCase; /** @@ -82,8 +82,8 @@ public function testLayout3Action() { $this->assertEquals("text/html; charset=UTF-8", $client->getResponse()->headers->get("Content-Type")); // Check the Bootstrap version. - //$this->assertContains(BootstrapInterface::BOOTSTRAP_VERSION_3 . "/css", $client->getResponse()->getContent()); - //$this->assertContains(BootstrapInterface::BOOTSTRAP_VERSION_3 . "/js", $client->getResponse()->getContent()); + //$this->assertContains(WBWBootstrapInterface::BOOTSTRAP_VERSION_3 . "/css", $client->getResponse()->getContent()); + //$this->assertContains(WBWBootstrapInterface::BOOTSTRAP_VERSION_3 . "/js", $client->getResponse()->getContent()); } /** @@ -100,8 +100,8 @@ public function testLayout4Action() { $this->assertEquals("text/html; charset=UTF-8", $client->getResponse()->headers->get("Content-Type")); // Check the Bootstrap version. - $this->assertContains(BootstrapInterface::BOOTSTRAP_VERSION_4 . "/css", $client->getResponse()->getContent()); - $this->assertContains(BootstrapInterface::BOOTSTRAP_VERSION_4 . "/js", $client->getResponse()->getContent()); + $this->assertContains(WBWBootstrapInterface::BOOTSTRAP_VERSION_4 . "/css", $client->getResponse()->getContent()); + $this->assertContains(WBWBootstrapInterface::BOOTSTRAP_VERSION_4 . "/js", $client->getResponse()->getContent()); } /** @@ -118,8 +118,8 @@ public function testLayoutAction() { $this->assertEquals("text/html; charset=UTF-8", $client->getResponse()->headers->get("Content-Type")); // Check the Bootstrap version. - $this->assertContains(BootstrapInterface::BOOTSTRAP_VERSION_4 . "/css", $client->getResponse()->getContent()); - $this->assertContains(BootstrapInterface::BOOTSTRAP_VERSION_4 . "/js", $client->getResponse()->getContent()); + $this->assertContains(WBWBootstrapInterface::BOOTSTRAP_VERSION_4 . "/css", $client->getResponse()->getContent()); + $this->assertContains(WBWBootstrapInterface::BOOTSTRAP_VERSION_4 . "/js", $client->getResponse()->getContent()); } /** diff --git a/Tests/Helper/AssetsHelperTest.php b/Tests/Helper/AssetsHelperTest.php index e74c49c0..d946039c 100644 --- a/Tests/Helper/AssetsHelperTest.php +++ b/Tests/Helper/AssetsHelperTest.php @@ -12,7 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Tests\Helper; use Exception; -use WBW\Bundle\BootstrapBundle\BootstrapInterface; +use WBW\Bundle\BootstrapBundle\WBWBootstrapInterface; use WBW\Bundle\BootstrapBundle\Tests\AbstractTestCase; use WBW\Bundle\CoreBundle\Tests\Fixtures\Helper\TestAssetsHelper; @@ -52,8 +52,8 @@ public function testListAssets() { $res = TestAssetsHelper::listAssets($this->directoryAssets); $this->assertCount(19, $res); - $this->assertRegExp("/bootstrap\-" . preg_quote(BootstrapInterface::BOOTSTRAP_VERSION_3, ".") . "\.zip$/", $res[0]); - $this->assertRegExp("/bootstrap\-" . preg_quote(BootstrapInterface::BOOTSTRAP_VERSION_4, ".") . "\.zip$/", $res[1]); + $this->assertRegExp("/bootstrap\-" . preg_quote(WBWBootstrapInterface::BOOTSTRAP_VERSION_3, ".") . "\.zip$/", $res[0]); + $this->assertRegExp("/bootstrap\-" . preg_quote(WBWBootstrapInterface::BOOTSTRAP_VERSION_4, ".") . "\.zip$/", $res[1]); $this->assertRegExp("/bootstrap\-colorpicker\-.*\.zip$/", $res[2]); $this->assertRegExp("/bootstrap\-datepicker\-.*\.zip$/", $res[3]); $this->assertRegExp("/bootstrap\-daterangepicker\-.*\.zip$/", $res[4]); diff --git a/Tests/ProgressBar/ProgressBarInterfaceTest.php b/Tests/ProgressBar/ProgressBarInterfaceTest.php index bafe48bc..315ddd50 100644 --- a/Tests/ProgressBar/ProgressBarInterfaceTest.php +++ b/Tests/ProgressBar/ProgressBarInterfaceTest.php @@ -11,7 +11,7 @@ namespace WBW\Bundle\BootstrapBundle\Tests\ProgressBar; -use WBW\Bundle\BootstrapBundle\BootstrapInterface; +use WBW\Bundle\BootstrapBundle\WBWBootstrapInterface; use WBW\Bundle\BootstrapBundle\ProgressBar\ProgressBarInterface; use WBW\Bundle\BootstrapBundle\Tests\AbstractTestCase; @@ -30,9 +30,9 @@ class ProgressBarInterfaceTest extends AbstractTestCase { */ public function testConstruct() { - $this->assertEquals(BootstrapInterface::BOOTSTRAP_DANGER, ProgressBarInterface::PROGRESS_BAR_TYPE_DANGER); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_INFO, ProgressBarInterface::PROGRESS_BAR_TYPE_INFO); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_SUCCESS, ProgressBarInterface::PROGRESS_BAR_TYPE_SUCCESS); - $this->assertEquals(BootstrapInterface::BOOTSTRAP_WARNING, ProgressBarInterface::PROGRESS_BAR_TYPE_WARNING); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_DANGER, ProgressBarInterface::PROGRESS_BAR_TYPE_DANGER); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_INFO, ProgressBarInterface::PROGRESS_BAR_TYPE_INFO); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_SUCCESS, ProgressBarInterface::PROGRESS_BAR_TYPE_SUCCESS); + $this->assertEquals(WBWBootstrapInterface::BOOTSTRAP_WARNING, ProgressBarInterface::PROGRESS_BAR_TYPE_WARNING); } } diff --git a/Tests/WBWBootstrapInterfaceTest.php b/Tests/WBWBootstrapInterfaceTest.php new file mode 100644 index 00000000..2c56b412 --- /dev/null +++ b/Tests/WBWBootstrapInterfaceTest.php @@ -0,0 +1,44 @@ + + * @package WBW\Bundle\BootstrapBundle\Tests + */ +class WBWBootstrapInterfaceTest extends AbstractTestCase { + + /** + * Tests the __construct() method. + * + * @return void + */ + public function testConstruct() { + + $this->assertEquals("3.4.1", WBWBootstrapInterface::BOOTSTRAP_VERSION_3); + $this->assertEquals("4.4.1", WBWBootstrapInterface::BOOTSTRAP_VERSION_4); + + $this->assertEquals("danger", WBWBootstrapInterface::BOOTSTRAP_DANGER); + $this->assertEquals("dark", WBWBootstrapInterface::BOOTSTRAP_DARK); + $this->assertEquals("default", WBWBootstrapInterface::BOOTSTRAP_DEFAULT); + $this->assertEquals("info", WBWBootstrapInterface::BOOTSTRAP_INFO); + $this->assertEquals("light", WBWBootstrapInterface::BOOTSTRAP_LIGHT); + $this->assertEquals("primary", WBWBootstrapInterface::BOOTSTRAP_PRIMARY); + $this->assertEquals("secondary", WBWBootstrapInterface::BOOTSTRAP_SECONDARY); + $this->assertEquals("success", WBWBootstrapInterface::BOOTSTRAP_SUCCESS); + $this->assertEquals("warning", WBWBootstrapInterface::BOOTSTRAP_WARNING); + } +} diff --git a/Twig/Extension/Component/LabelTwigExtension.php b/Twig/Extension/Component/LabelTwigExtension.php index 78719a26..52029b12 100644 --- a/Twig/Extension/Component/LabelTwigExtension.php +++ b/Twig/Extension/Component/LabelTwigExtension.php @@ -12,7 +12,7 @@ namespace WBW\Bundle\BootstrapBundle\Twig\Extension\Component; use Twig\TwigFunction; -use WBW\Bundle\BootstrapBundle\BootstrapInterface; +use WBW\Bundle\BootstrapBundle\WBWBootstrapInterface; use WBW\Library\Core\Argument\ArrayHelper; /** @@ -38,7 +38,7 @@ class LabelTwigExtension extends AbstractLabelTwigExtension { * @return string Returns the Bootstrap label "danger". */ public function bootstrapLabelDangerFunction(array $args = []) { - return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . BootstrapInterface::BOOTSTRAP_DANGER); + return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . WBWBootstrapInterface::BOOTSTRAP_DANGER); } /** @@ -48,7 +48,7 @@ public function bootstrapLabelDangerFunction(array $args = []) { * @return string Returns the Bootstrap label "default". */ public function bootstrapLabelDefaultFunction(array $args = []) { - return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . BootstrapInterface::BOOTSTRAP_DEFAULT); + return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . WBWBootstrapInterface::BOOTSTRAP_DEFAULT); } /** @@ -58,7 +58,7 @@ public function bootstrapLabelDefaultFunction(array $args = []) { * @return string Returns the Bootstrap label "info". */ public function bootstrapLabelInfoFunction(array $args = []) { - return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . BootstrapInterface::BOOTSTRAP_INFO); + return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . WBWBootstrapInterface::BOOTSTRAP_INFO); } /** @@ -68,7 +68,7 @@ public function bootstrapLabelInfoFunction(array $args = []) { * @return string Returns the Bootstrap label "primary". */ public function bootstrapLabelPrimaryFunction(array $args = []) { - return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . BootstrapInterface::BOOTSTRAP_PRIMARY); + return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . WBWBootstrapInterface::BOOTSTRAP_PRIMARY); } /** @@ -78,7 +78,7 @@ public function bootstrapLabelPrimaryFunction(array $args = []) { * @return string Returns the Bootstrap label "success". */ public function bootstrapLabelSuccessFunction(array $args = []) { - return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . BootstrapInterface::BOOTSTRAP_SUCCESS); + return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . WBWBootstrapInterface::BOOTSTRAP_SUCCESS); } /** @@ -88,7 +88,7 @@ public function bootstrapLabelSuccessFunction(array $args = []) { * @return string Returns the Bootstrap label "warning". */ public function bootstrapLabelWarningFunction(array $args = []) { - return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . BootstrapInterface::BOOTSTRAP_WARNING); + return $this->bootstrapLabel(ArrayHelper::get($args, "content"), "label-" . WBWBootstrapInterface::BOOTSTRAP_WARNING); } /** diff --git a/WBWBootstrapInterface.php b/WBWBootstrapInterface.php new file mode 100644 index 00000000..8dca9901 --- /dev/null +++ b/WBWBootstrapInterface.php @@ -0,0 +1,96 @@ + + */ +interface WBWBootstrapInterface { + + /** + * Bootstrap "danger". + * + * @var string + */ + const BOOTSTRAP_DANGER = "danger"; + + /** + * Bootstrap "dark". + * + * @var string + */ + const BOOTSTRAP_DARK = "dark"; + + /** + * Bootstrap "default". + * + * @var string + */ + const BOOTSTRAP_DEFAULT = "default"; + + /** + * Bootstrap "info". + * + * @var string + */ + const BOOTSTRAP_INFO = "info"; + + /** + * Bootstrap "light". + * + * @var string + */ + const BOOTSTRAP_LIGHT = "light"; + + /** + * Bootstrap "primary". + * + * @var string + */ + const BOOTSTRAP_PRIMARY = "primary"; + + /** + * Bootstrap "secondary". + * + * @var string + */ + const BOOTSTRAP_SECONDARY = "secondary"; + + /** + * Bootstrap "success". + * + * @var string + */ + const BOOTSTRAP_SUCCESS = "success"; + + /** + * Bootstrap version 3. + * + * @var string + */ + const BOOTSTRAP_VERSION_3 = "3.4.1"; + + /** + * Bootstrap version 4. + * + * @var string + */ + const BOOTSTRAP_VERSION_4 = "4.4.1"; + + /** + * Bootstrap "warning". + * + * @var string + */ + const BOOTSTRAP_WARNING = "warning"; +}