Commit 40b16e34 authored by Jens Segers's avatar Jens Segers

Adding <> to queries and extra tests

parent e23241d0
......@@ -20,6 +20,7 @@ class Builder extends \Illuminate\Database\Query\Builder {
protected $conversion = array(
'=' => '=',
'!=' => '$ne',
'<>' => '$ne',
'<' => '$lt',
'<=' => '$lte',
'>' => '$gt',
......
......@@ -66,7 +66,7 @@ class ModelTest extends PHPUnit_Framework_TestCase {
$check->save();
$this->assertEquals(true, $check->exists);
$this->assertInstanceOf('DateTime', $user->created_at);
$this->assertInstanceOf('DateTime', $check->created_at);
$this->assertInstanceOf('DateTime', $check->updated_at);
$this->assertEquals(1, User::count());
......@@ -185,7 +185,6 @@ class ModelTest extends PHPUnit_Framework_TestCase {
$this->assertEquals(true, $user->exists);
$user->delete();
$this->assertEquals(false, $user->exists);
$check = Soft::find($user->_id);
$this->assertEquals(null, $check);
......@@ -195,6 +194,14 @@ class ModelTest extends PHPUnit_Framework_TestCase {
$all = Soft::withTrashed()->get();
$this->assertEquals(1, $all->count());
$check = $all[0];
$this->assertInstanceOf('DateTime', $check->deleted_at);
$this->assertEquals(true, $check->trashed());
$check->restore();
$all = Soft::get();
$this->assertEquals(1, $all->count());
}
}
\ No newline at end of file
......@@ -61,6 +61,9 @@ class QueryTest extends PHPUnit_Framework_TestCase {
$users = User::where('age', '!=', 35)->get();
$this->assertEquals(6, count($users));
$users = User::where('age', '<>', 35)->get();
$this->assertEquals(6, count($users));
}
public function testAndWhere()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment