Ejemplo n.º 1
0
	/**
	 * Tests the JDatabase::replacePrefix method.
	 *
	 * @return  void
	 *
	 * @since   12.1
	 */
	public function testReplacePrefix()
	{
		$this->assertThat(
			$this->db->replacePrefix('SELECT * FROM #__dbtest'),
			$this->equalTo('SELECT * FROM &dbtest'),
			'replacePrefix method should return the query string with the #__ prefix replaced by the actual table prefix.'
		);
	}
Ejemplo n.º 2
0
 /**
  * Replace $prefix with $this->getPrefix() in $sql
  *
  * @param  string $sql    SQL query
  * @param  string $prefix Common table prefix
  * @return string
  */
 public function replacePrefix($sql, $prefix = '#__')
 {
     return $this->_db->replacePrefix($sql, $prefix);
 }