コード例 #1
0
 public function testFirst()
 {
     $m1 = Blueprint::make('Model1', ['int1' => 1, 'str1' => 'firsttest']);
     $m2 = Blueprint::make('Model1', ['int1' => 2, 'str1' => 'firsttest']);
     $this->assertEquals($m1->id, Model1::first(['str1' => 'firsttest', '@order' => 'int1'])->id);
     $this->assertEquals($m2->id, Model1::first(['str1' => 'firsttest', '@order' => 'int1:desc'])->id);
 }