function test_deleteAll() { //Arrange $brand_name = "Nike"; $test_brand = new Brand($brand_name); $test_brand->save(); //Act Brand::deleteAll(); $result = $test_brand->getAll(); //Assert $this->assertEquals([], $result); }
function test_deleteAll() { //Arrange $name = "Nike"; $test_brand = new Brand($name); $test_brand->save(); $name2 = "Adidas"; $test_brand2 = new Brand($name2); $test_brand2->save(); //Act Brand::deleteAll(); $result = Brand::getAll(); //Assert $this->assertEquals([], $result); }
function test_deleteAll() { //Arrange $name = "Crocs"; $test_brand = new Brand($name); $test_brand->save(); $name2 = "Doc Martins"; $test_brand2 = new Brand($name); $test_brand2->save(); //Act Brand::deleteAll(); //Assert $result = Brand::getAll(); $this->assertEquals([], $result); }
function testDeleteAll() { //Arrange $brand_name = "Super Kicks"; $test_brand = new Brand($brand_name); $test_brand->save(); $brand_name2 = "Cool Shoes"; $test_brand2 = new Brand($brand_name2); $test_brand->save(); //Act Brand::deleteAll(); $result = Brand::getAll(); //Assert $this->assertEquals([], $result); }
function testDeleteAll() { //Arrange $brand_name = "Sketchers"; $test_brand = new Brand($brand_name); $test_brand->save(); $another_brand = "Doc Martin"; $test_brand2 = new Brand($another_brand); $test_brand2->save(); //Act Brand::deleteAll(); $result = Brand::getAll(); //Assert $this->assertEquals([], $result); }
function testDeleteAll() { //Arrange $id = null; $brand_name = "Nike"; $test_brand = new Brand($id, $brand_name); $test_brand->save(); $brand_name2 = "Salamon"; $test_brand2 = new Brand($id, $brand_name); $test_brand2->save(); //Act Brand::deleteAll(); //Assert $result = Brand::getAll(); $this->assertEquals([], $result); }
function testDeleteAll() { //Arrange $name = "vans"; $id = 1; $test_brand = new Brand($name, $id); $test_brand->save(); $name2 = "crocs"; $id2 = 2; $test_brand2 = new Brand($name2, $id2); $test_brand2->save(); //Act Brand::deleteAll(); $result = Brand::getAll(); //Assert $this->assertEquals([], $result); }
function test_deleteAll() { //Arrange $name = "Nike"; $website = "http://www.nike.com"; $test_brand = new Brand($name, $website); $test_brand->save(); $name2 = "Adidas"; $website2 = "http://www.adidas.com"; $test_brand2 = new Brand($name2, $website2); $test_brand2->save(); //Act Brand::deleteAll(); //Assert $result = Brand::getAll(); $this->assertEquals([], $result); }
function test_brand_deleteAll() { //Arrange $brand_name = "Nike"; $id1 = 1; $test_brand = new Brand($brand_name, $id1); $test_brand->save(); $brand_name2 = "Converse"; $id2 = 2; $test_brand2 = new Brand($brand_name2, $id2); $test_brand2->save(); //Act Brand::deleteAll(); //Assert $result = Brand::getAll(); $this->assertEquals([], $result); }
function test_deleteAll() { //arrange $name = "Running"; $id = 1; $test_brand1 = new Brand($name, $id); $test_brand1->save(); //act $name2 = "work"; $id2 = 2; $test_brand2 = new Brand($name2, $id2); $test_brand2->save(); Brand::deleteAll(); $result = Brand::getAll(); //assert $this->assertEquals([], $result); }
protected function tearDown() { Store::deleteAll(); Brand::deleteAll(); }
protected function tearDown() { Store::deleteAll(); Brand::deleteAll(); $GLOBALS['DB']->exec("DELETE FROM brands_stores;"); }
function testDeleteAll() { $brand_name = "dr.martens"; $new_brand = new Brand($brand_name); $new_brand->save(); $brand_name2 = "adidas"; $new_brand2 = new Brand($brand_name); $new_brand2->save(); Brand::deleteAll(); $result = Brand::getAll(); $this->assertEquals([], $result); }
function testDeleteAll() { //Arrange $brand_name = "Nike"; $id = 1; $test_brand = new Brand($brand_name, $id); $brand_name2 = "Reebok"; $id2 = 2; $test_brand2 = new Brand($brand_name2, $id2); //Act Brand::deleteAll(); //Assert $result = Brand::getALl(); $this->assertEquals([], $result); }
protected function tearDown() { Store::deleteAll(); Brand::deleteAll(); $GLOBALS['DB']->exec("DELETE FROM availability;"); }
function test_deleteAll() { //Arrange $brand_name = "BRAH-DIDAS"; $id = 1; $test_brand = new Brand($brand_name, $id); $test_brand->save(); $brand_name2 = "K-SWISS-CHEESE"; $id2 = 2; $test_brand2 = new Brand($brand_name2, $id2); $test_brand2->save(); //Act Brand::deleteAll(); //Assert $result = Brand::getAll(); $this->assertEquals([], $result); }
function test_deleteAll() { $brand_name = "La Sportiva"; $test_brand = new Brand($brand_name); $test_brand->save(); $brand_name2 = "Evolv"; $test_brand2 = new Brand($brand_name2); $test_brand2->save(); //Act Brand::deleteAll(); $result = Brand::getAll(); //Assert $this->assertEquals([], $result); }
function testDeleteAll() { //Arrange $brand_name = "Feiyue"; $test_brand = new Brand($brand_name, $id = null); $test_brand->save(); $brand_name2 = "Kailai"; $test_brand2 = new Brand($brand_name2, $id = null); $test_brand2->save(); //Act Brand::deleteAll(); //Assert $result = Brand::getAll(); $this->assertEquals([], $result); }
function testDeleteAll() { // Arrange $name = "Babbling Brooks"; $test_Brand = new Brand($name); $test_Brand->save(); $name2 = "Old Balance"; $test_Brand2 = new Brand($name2); $test_Brand2->save(); // Act Brand::deleteAll(); $result = Brand::getAll(); // Assert $this->assertEquals([], $result); }
protected function tearDown() { // one needed for each class Store::deleteAll(); Brand::deleteAll(); }
//EDIT GETS $app->get("/stores/{id}", function ($id) use($app) { $store = Store::find($id); return $app['twig']->render('store.html.twig', array('store' => $store, 'brands' => $store->getBrands(), 'all_brands' => Brand::getAll())); }); $app->get("/brands/{id}", function ($id) use($app) { $brand = Brand::find($id); return $app['twig']->render('brand.html.twig', array('brand' => $brand, 'stores' => $brand->getStores(), 'all_stores' => Store::getAll())); }); //DELETES $app->post("/delete_stores", function () use($app) { Store::deleteAll(); return $app['twig']->render('stores.html.twig', array('stores' => Store::getAll())); }); $app->post("/delete_brands", function () use($app) { Brand::deleteAll(); return $app['twig']->render('brands.html.twig', array('brands' => Brand::getAll())); }); //POSTS (ADDS) $app->post("/add_stores", function () use($app) { $store = Store::find($_POST['store_id']); $brand = Brand::find($_POST['brand_id']); $brand->addStore($store); return $app['twig']->render('brand.html.twig', array('brand' => $brand, 'brands' => Brand::getAll(), 'stores' => $brand->getStores(), 'all_stores' => Store::getAll())); }); $app->post("/add_brands", function () use($app) { $store = Store::find($_POST['store_id']); $brand = Brand::find($_POST['brand_id']); $store->addBrand($brand); return $app['twig']->render('store.html.twig', array('store' => $store, 'stores' => Store::getAll(), 'brands' => $store->getBrands(), 'all_brands' => Brand::getAll())); });
function test_deleteAll() { $brand_name = "nike"; $test_brand = new Brand($brand_name); $test_brand->save(); $brand_name2 = "addidas"; $test_brand2 = new Brand($brand_name2); $test_brand2->save(); //Act Brand::deleteAll(); $result = Brand::getAll(); //Assert $this->assertEquals([], $result); }