/** * @covers Braincrafted\Bundle\BootstrapBundle\Twig\BootstrapFormExtension::backupFormSettings() * @covers Braincrafted\Bundle\BootstrapBundle\Twig\BootstrapFormExtension::restoreFormSettings() */ public function testBackupFormSettingsRestoreFormSettings() { $this->extension->setStyle('horizontal'); $this->extension->setColSize('sm'); $this->extension->setWidgetCol(1); $this->extension->setLabelCol(2); $this->extension->setSimpleCol(3); $this->extension->backupFormSettings(); $this->extension->setStyle('inline'); $this->extension->setColSize('lg'); $this->extension->setWidgetCol(4); $this->extension->setLabelCol(5); $this->extension->setSimpleCol(6); $this->extension->restoreFormSettings(); $this->assertEquals('horizontal', $this->extension->getStyle()); $this->assertEquals('sm', $this->extension->getColSize()); $this->assertEquals(1, $this->extension->getWidgetCol()); $this->assertEquals(2, $this->extension->getLabelCol()); $this->assertEquals(3, $this->extension->getSimpleCol()); // Nothing happens if we try to restore form settings but none exist $this->extension->restoreFormSettings(); }
/** * @covers Braincrafted\Bundle\BootstrapBundle\Twig\BootstrapFormExtension::setLabelCol() * @covers Braincrafted\Bundle\BootstrapBundle\Twig\BootstrapFormExtension::getLabelCol() */ public function testSetLabelColGetLabelCol() { $this->extension->setLabelCol(4); $this->assertEquals(4, $this->extension->getLabelCol()); }