Esempio n. 1
0
 public function testFindByOwner()
 {
     $this->specify("Searching by owner must be work", function () {
         $owner = $this->employees('employee1');
         expect(Number::findAll(['ownerId' => $owner->id]))->equals(Number::findByOwner($owner->fullName, $owner->post)->all());
         expect("Numbers must be find", Number::findByOwner($owner->fullName)->count())->greaterThan(0);
         expect("Numbers must be find", Number::findByOwner($owner->fullName, $owner->post)->count())->greaterThan(0);
         expect("Numbers must be not find", Number::findByOwner("Не существующий сотрудник")->count())->equals(0);
         expect("Numbers must be not find", Number::findByOwner($owner->fullName, "Не существующая должность")->count())->equals(0);
     });
 }