public function testcreate_list_query() { $call = new Call(); //test with empty string params $expected = "SELECT \n\t\t\tcalls.*,\n\t\t\tusers.user_name as assigned_user_name FROM calls \n\t\t\tLEFT JOIN users\n\t\t\tON calls.assigned_user_id=users.id where calls.deleted=0 ORDER BY calls.name"; $actual = $call->create_list_query('', ''); $this->assertSame($expected, $actual); //test with valid string params $expected = "SELECT \n\t\t\tcalls.*,\n\t\t\tusers.user_name as assigned_user_name FROM calls \n\t\t\tLEFT JOIN users\n\t\t\tON calls.assigned_user_id=users.id where users.user_name=\"\" AND calls.deleted=0 ORDER BY calls.name"; $actual = $call->create_list_query('name', 'users.user_name=""'); $this->assertSame($expected, $actual); }