public function setUp() { parent::setUp(); $this->initModels([new User(), new Group(), new Membership(), new Customer()]); $group = new Group(); $group->name = 'Administrators'; $group->save(); $group_prog = new Group(); $group_prog->name = 'Programmers'; $group_prog->save(); $anton = new User(); $anton->username = '******'; $anton->password = '******'; $anton->save(); $group_prog->users->link($anton); $anton_home = new Customer(); $anton_home->address = "Anton home"; $anton_home->user = $anton; $anton_home->save(); $anton_work = new Customer(); $anton_work->address = "Anton work"; $anton_work->user = $anton; $anton_work->save(); $max = new User(); $max->username = '******'; $max->password = '******'; $max->save(); $group->users->link($max); $max_home = new Customer(); $max_home->address = "Max home"; $max_home->user = $max; $max_home->save(); }
public function setUp() { parent::setUp(); foreach (range(0, 11) as $i) { (new Category(['name' => 'foo' . $i]))->save(); } }
public function setUp() { parent::setUp(); $this->basePath = realpath(__DIR__ . '/../../protected'); $group = new Group(); $group->name = 'Administrators'; $group->save(); $group_prog = new Group(); $group_prog->name = 'Programmers'; $group_prog->save(); $anton = new User(); $anton->username = '******'; $anton->password = '******'; $anton->save(); $group_prog->users->link($anton); $anton_home = new Customer(); $anton_home->address = "Anton home"; $anton_home->user = $anton; $anton_home->save(); $anton_work = new Customer(); $anton_work->address = "Anton work"; $anton_work->user = $anton; $anton_work->save(); $max = new User(); $max->username = '******'; $max->password = '******'; $max->save(); $group->users->link($max); $group_prog->users->link($max); $max_home = new Customer(); $max_home->address = "Max home"; $max_home->user = $max; $max_home->save(); }
public function setUp() { parent::setUp(); $user = new User(['username' => 'foo']); $user->save(); (new User(['username' => 'bar']))->save(); (new Customer(['user' => $user, 'address' => 'address']))->save(); }
public function setUp() { parent::setUp(); $model_one = new Category(); $model_one->name = 'one'; $model_one->save(); $model_two = new Category(); $model_two->name = 'two'; $model_two->save(); }
public function setUp() { parent::setUp(); $user = new User(['username' => 'foo']); $user->save(); (new User(['username' => 'bar']))->save(); (new Customer(['user' => $user, 'address' => 'address']))->save(); $tyre = new Tyre(); $tyre->save(); $modelTyre = new ModelTyre(['tyre' => $tyre, 'name' => 'Nordman 4']); $modelTyre->save(); $modelTyre = new ModelTyre(['tyre' => $tyre, 'name' => 'Nordman 3']); $modelTyre->save(); $modelTyre = new ModelTyre(['tyre' => $tyre, 'name' => 'Nordman 2']); $modelTyre->save(); }
public function setUp() { parent::setUp(); $category = new Category(['name' => 'cat']); $category->save(); $product1 = new Product(['name' => 'foo', 'category' => $category]); $product1->save(); $product2 = new Product(['name' => 'bar', 'category' => $category]); $product2->save(); $list = new ProductList(['name' => 'test']); $list->save(); $list->products->link($product1); $list->products->link($product2); $list = new ProductList(['name' => 'asd']); $list->save(); $list->products->link($product1); }
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; }
public function setUp() { parent::setUp(); $category = new Category(); $category->name = 'test'; $category->save(); $product_list = new ProductList(); $product_list->name = 'First product list'; $product_list->date_action = '2014-04-29 10:35:45'; $product_list->save(); $user = new User(); $user->password = 123456; $user->username = '******'; $user->save(); $customer = new Customer(); $customer->user = $user; $customer->address = 'example super address'; $customer->save(); $products = []; foreach ([1, 2, 3, 4, 5] as $i) { $product = new Product(); $product->name = $i; $product->price = $i; $product->description = $i; $product->category = $category; $product->save(); $products[] = $product; } $order = new Order(); $order->customer = $customer; $order->save(); $order->products = $products; $order->save(); $model = new Category(); $this->prefix = $model->getDb()->tablePrefix; }
public function setUp() { parent::setUp(); $group = new Group(); $group->name = 'Administrators'; $group->save(); $group_prog = new Group(); $group_prog->name = 'Programmers'; $group_prog->save(); $anton = new User(); $anton->username = '******'; $anton->password = '******'; $anton->save(); $group->users->link($anton); $group_prog->users->link($anton); $anton_home = new Customer(); $anton_home->address = "Anton home"; $anton_home->user = $anton; $anton_home->save(); $anton_work = new Customer(); $anton_work->address = "Anton work"; $anton_work->user = $anton; $anton_work->save(); $max = new User(); $max->username = '******'; $max->password = '******'; $max->save(); $group->users->link($max); $group_prog->users->link($max); $max_home = new Customer(); $max_home->address = "Max home"; $max_home->user = $max; $max_home->save(); $model = new Customer(); $this->prefix = $model->getDb()->tablePrefix; }