/** * Test for `MySqlQuery::whereRaw()`. * * @since 1.0.0 * @access public * * @requires function Freyja\Database\Query\MySqlQuery::whereRaw * @requires function Freyja\Database\Query\MySqlQuery::where * @requires function ReflectionProperty::setAccessible * @requires function ReflectionProperty::getValue */ public function testWhereRawChainedAfterWhere() { // Set accessibility to object property. $reflection_where = new ReflectionProperty('Freyja\\Database\\Query\\MySqlQuery', 'where'); $reflection_where->setAccessible(true); $query = new MySqlQuery(); $query->where('other_field', null)->whereRaw('WHERE field = 56'); $this->assertEquals('WHERE field = 56', $reflection_where->getValue($query), 'Failed asserting that MySqlQuery::whereRaw() correctly set a where clause, if chained after MySqlQuery::where().'); }