Esempio n. 1
0
 public function setUp()
 {
     parent::setUp();
     $group = new Group();
     $group->name = 'test';
     $group->save();
     $this->items = [['username' => 'Anton', 'password' => 'VeryGoodPassWord'], ['username' => 'Max', 'password' => 'The6estP@$$w0rd']];
     $users = [];
     foreach ($this->items as $item) {
         $tmp = new User($item);
         $tmp->save();
         $users[] = $tmp;
     }
     foreach ($users as $user) {
         $group->users->link($user);
         Customer::objects()->getOrCreate(['address' => 'test', 'user' => $user]);
     }
     $model = new User();
     $this->prefix = $model->getDb()->tablePrefix;
 }