/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void * * @since 3.0 */ protected function setUp() { parent::setUp(); // Store the factory state so we can mock the necessary objects $this->saveFactoryState(); JFactory::$database = $this->getMockDatabase('Mysqli'); // Register the object $this->object = JSchemaChangeset::getInstance(JFactory::getDbo(), null); }
/** * Gets the changeset object * * @return JSchemaChangeset */ public function getItems() { $folder = JPATH_ADMINISTRATOR . '/components/com_admin/sql/updates/'; try { $changeSet = JSchemaChangeset::getInstance(JFactory::getDbo(), $folder); } catch (RuntimeException $e) { JFactory::getApplication()->enqueueMessage($e->getMessage(), 'warning'); return false; } return $changeSet; }
/** * Get database changeset * * @copyright * @author RolandD * @todo * @see * @access * @param * @return Changeset class * @since 5.6 */ public function getChangeSet() { $folder = JPATH_ADMINISTRATOR . '/components/com_csvi/sql/updates/'; $changeSet = JSchemaChangeset::getInstance(JFactory::getDbo(), $folder); return $changeSet; }
/** * Gets the changeset object * * @return JSchemaChangeset * * @since 1.7.0 */ public function getItems() { $folder = JPATH_COMPONENT_ADMINISTRATOR . '/sql/updates/'; $changeSet = JSchemaChangeset::getInstance(JFactory::getDbo(), $folder); return $changeSet; }
/** * Tests the getInstance method with the MySQL driver * * @return void * * @since 3.0 */ public function testGetInstanceMysql() { $this->assertThat(JSchemaChangeset::getInstance($this->db, null), $this->isInstanceOf('JSchemaChangeset')); }
/** * * Gets the changeset object * * @return JSchemaChangeset */ public function getItems() { $folder = PATH_CORE . '/components/com_admin/amdin/sql/updates/'; $changeSet = \JSchemaChangeset::getInstance(\App::get('db'), $folder); return $changeSet; }