function test_removeStores() { //Arrange //Make two test Brands $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(); //Make two test Stores $name = "Burchs"; $location = "Oakway Center"; $phone = "5415131122"; $test_store = new Store($name, $location, $phone); $test_store->save(); $name2 = "Payless ShoeSource"; $location2 = "Valley River Center"; $phone2 = "5415130809"; $test_store2 = new Store($name2, $location2, $phone2); $test_store2->save(); // Add both stores to second Brand $test_brand2->addStore($test_store); $test_brand2->addStore($test_store2); //Act $test_brand2->removeStores(); //Assert $result = $test_brand2->getStores(); $this->assertEquals([], $result); }
$app->get("/brand_store", function () use($app) { return $app['twig']->render('brand_store.html.twig', array('brands' => Brand::getAll(), 'display_form' => false)); }); $app->post("/brand/{id}", function ($id) use($app) { $brand = Brand::find($id); $store = Store::find($_POST['store_id']); $brand->addStore($store); return $app['twig']->render('brand.html.twig', array('brands' => Brand::getAll(), 'brand_stores' => $brand->getStores(), 'display_form' => false, 'all_stores' => Store::getAll())); }); $app->get("/brand_store_add_form", function () use($app) { return $app['twig']->render('brand_store.html.twig', array('brands' => Brand::getAll(), 'display_form' => true)); }); $app->post("/add_brand", function () use($app) { $brand = new Brand($_POST['brand_name']); $brand->save(); return $app['twig']->render('brand.html.twig', array('brands' => Brand::getAll(), 'brand_stores' => $brand->getStores(), 'display_form' => false, 'all_stores' => Store::getAll())); }); $app->get("/brand/{id}", function ($id) use($app) { $brand = Brand::find($id); return $app['twig']->render('brand.html.twig', array('brands' => Brand::getAll(), 'brand_stores' => $brand->getStores(), 'display_form' => false, 'all_stores' => Store::getAll())); }); $app->post("/brands/{id}", function ($id) use($app) { $brand = Brand::find($id); $store = Store::find($_POST['store_id']); $brand->addStore($store); return $app['twig']->render('brand.html.twig', array('brand' => $brand, 'brand_stores' => $brand->getStores(), 'all_stores' => Store::getAll())); }); $app->get("/store_brand", function () use($app) { return $app['twig']->render('store_brand.html.twig', array('stores' => Store::getAll(), 'display_form' => false)); }); $app->get("/stores_add_form", function () use($app) {
function test_getCourses() { //Arrange $brand_name = "Nike"; $id = null; $test_brand = new Brand($brand_name, $id); $test_brand->save(); $store_name = "Nordstrom"; $test_store = new Store($store_name, $id); $test_store->save(); $store_name2 = "Footlocker"; $test_store2 = new Store($store_name2, $id); $test_store2->save(); //Act $test_brand->addStore($test_store->getId()); $test_brand->addStore($test_store2->getId()); //Assert $this->assertEquals($test_brand->getStores(), [$test_store, $test_store2]); }
function test_getStores() { //Arrange $store_name = "Shoe World"; $test_store = new Store($store_name); $test_store->save(); $brand_name = "La Sportiva"; $test_brand = new Brand($brand_name); $test_brand->save(); //Act $test_brand->addStore($test_store); $result = $test_brand->getStores(); //Assert $this->assertEquals([$test_store], $result); }
function test_addStore() { //Arrange $brand_name = "Nike"; $test_brand = new Brand($brand_name); $test_brand->save(); $store_name = "Flying Shoes"; $test_store = new Store($store_name); $test_store->save(); //Act $test_brand->addStore($test_store); //Assert $this->assertEquals($test_brand->getStores(), [$test_store]); }
function testGetStores() { // Arrange $brand_name = "Babbling Brooks"; $test_Brand = new Brand($brand_name); $test_Brand->save(); $store_name = "Get Your Kicks Co."; $test_Store = new Store($store_name); $test_Store->save(); $store_name2 = "I Wanna Run Fast Co."; $test_Store2 = new Store($store_name2); $test_Store2->save(); // Act $test_Brand->addStore($test_Store); $test_Brand->addStore($test_Store2); $result = $test_Brand->getStores(); // Assert $this->assertEquals([$test_Store, $test_Store2], $result); }
function test_getStores() { //Arrange $name = "Crocs"; $test_brand = new Brand($name); $test_brand->save(); $name = "The Shoe Store"; $location = "432 SW Tootsies Ave"; $phone = "503-555-5555"; $test_store = new Store($name, $location, $phone); $test_store->save(); $name2 = "Boots n Stuff"; $location2 = "900 WalkAlot Blvd."; $phone2 = "971-202-0292"; $test_store2 = new Store($name, $location, $phone); $test_store2->save(); //Act $test_brand->addStore($test_store); $test_brand->addStore($test_store2); //Assert $result = $test_brand->getStores(); $this->assertEquals([$test_store, $test_store2], $result); }
function test_getStores() { //Arrange $id = null; $store_name = "Fred Meyers"; $test_store = new Store($id, $store_name); $test_store->save(); $id2 = null; $store_name2 = "Safeway"; $test_store2 = new Store($id2, $store_name2); $test_store2->save(); $id3 = null; $brand_name = "Nike"; $test_brand = new Brand($id3, $brand_name); $test_brand->save(); $id4 = null; $brand_name2 = "Vans"; $test_brand2 = new Brand($id4, $brand_name2); $test_brand2->save(); //Act $test_brand->addStore($test_store); $test_brand->addStore($test_store2); $test_brand2->addStore($test_store2); //Assert $this->assertEquals($test_brand->getStores(), [$test_store, $test_store2]); }
function test_getStores() { //Arrange $name = "Nike"; $id = null; $test_brand = new Brand($name, $id); $test_brand->save(); $retailer = "Nordstrom"; $address = "1234 SW Main Street"; $phone = "123-456-7890"; $test_store = new Store($retailer, $address, $phone, $id); $test_store->save(); $retailer2 = "Macys"; $address2 = "400 SW 6th Avenue"; $phone2 = "888-888-8888"; $test_store2 = new Store($retailer2, $address2, $phone2, $id); $test_store2->save(); //Act $test_brand->addStore($test_store); $test_brand->addStore($test_store2); $result = $test_brand->getStores(); //Assert $this->assertEquals([$test_store, $test_store2], $result); }
function testGetStores() { //Arrange $name = "Shoe Store 1"; $test_store = new Store($name); $test_store->save(); $name2 = "Shoe Store 2"; $test_store2 = new Store($name2); $test_store2->save(); $brand_name = "Brand 1"; $test_brand = new Brand($brand_name); $test_brand->save(); //Act $test_brand->addStore($test_store); $test_brand->addStore($test_store2); $result = $test_brand->getStores(); //Assert $this->assertEquals([$test_store, $test_store2], $result); }
function testGetStores() { $name = "ShoeStore"; $id = 1; $test_store = new Store($name, $id); $test_store->save(); $name2 = "BlueShoe"; $id3 = 3; $test_store2 = new Store($name2, $id3); $test_store2->save(); $name = "Asics"; $id2 = 2; $test_brand = new Brand($name, $id2); $test_brand->save(); //Act $test_brand->addStore($test_store); $test_brand->addStore($test_store2); //Assert $this->assertEquals($test_brand->getStores(), [$test_store, $test_store2]); }
function testGetStores() { //Arrange $name = "Clogs-N-More"; $id = 1; $test_store = new Store($name, $id); $test_store->save(); $name2 = "Shoe Depot"; $id2 = 1; $test_store2 = new Store($name2, $id2); $test_store2->save(); $name = "Nike"; $id = 1; $test_brand = new Brand($name, $id); $test_brand->save(); //Act $test_brand->addStore($test_store); $test_brand->addStore($test_store2); $result = $test_brand->getStores(); //Assert $this->assertEquals([$test_store, $test_store2], $result); }
function test_getStores() { //Arrange $brand_name = "BRAH-DIDAS"; $id = 1; $test_brand = new Brand($brand_name, $id); $test_brand->save(); $store_name = "LOTSA SHOES HERE"; $id2 = 2; $test_store = new Store($store_name, $id2); $test_store->save(); $store_name2 = "PLZ BUY SHOES HERE"; $id3 = 3; $test_store2 = new Store($store_name2, $id3); $test_store2->save(); //Act $test_brand->addStore($test_store); $test_brand->addStore($test_store2); //Assert $this->assertEquals($test_brand->getStores(), [$test_store, $test_store2]); }
function test_brand_getStore() { //Arrange $brand_name = "Nike"; $id1 = 1; $test_brand = new Brand($brand_name, $id1); $test_brand->save(); $store_name2 = "Goody New Shoes"; $test_store2 = new Store($store_name2); $test_store2->save(); $test_brand->addStore($test_store2); $store_name = "Groos Shoes"; $test_store = new Store($store_name); $test_store->save(); $test_brand->addStore($test_store); //Act $result = $test_brand->getStores(); //Assert $this->assertEquals([$test_store2, $test_store], $result); }
function testGetStores() { $brand_name = "Air Jordan"; $test_brand = new Brand($brand_name); $test_brand->save(); $name = "Foot Locker"; $phone_number = "555-555-5555"; $address = "123 ABC Street"; $test_store = new Store($name, $phone_number, $address); $test_store->save(); $name2 = "Nike Outlet"; $phone_number2 = "444-444-4444"; $address2 = "456 CBA Ave."; $test_store2 = new Store($name2, $phone_number2, $address2); $test_store2->save(); $test_brand->addStore($test_store); $test_brand->addStore($test_store2); $result = $test_brand->getStores(); $this->assertEquals([$test_store, $test_store2], $result); }
function testAddStore() { //Assert $brand_name = "Nike"; $test_brand = new Brand($brand_name); $test_brand->save(); $store_location = "Lloyd Center"; $test_store = new Store($store_location); $test_store->save(); //Act $test_brand->addStore($test_store); $result = $test_brand->getStores(); //Assert $this->assertEquals([$test_store], $result); }
function testgetStores() { //Arrange $name = "crocs store "; $id = 1; $test_brand = new Brand($name, $id); $test_brand->save(); $name1 = "shoe store"; $location = "123 n fake st"; $id1 = 4; $test_store = new Store($name1, $location, $id1); $test_store->save(); $name2 = "addidas store "; $location2 = "321 s real st"; $id2 = 3; $test_store2 = new Store($name2, $location2, $id2); $test_store2->save(); //Act $test_brand->addStore($test_store); $test_brand->addStore($test_store2); $result = $test_brand->getStores(); //Assert $this->assertEquals([$test_store, $test_store2], $result); }
function testGetStores() { //Arrange $brand_name = "Super Kicks"; $test_brand = new Brand($brand_name); $test_brand->save(); $store_name = "Shoes Galore"; $test_store = new Store($store_name); $test_store->save(); $store_name2 = "Save Our Soles"; $test_store2 = new Store($store_name2); $test_store2->save(); //Act $test_brand->addStore($test_store); $test_brand->addStore($test_store2); $result = $test_brand->getStores(); //Assert $this->assertEquals([$test_store, $test_store2], $result); }
function test_getStores() { //Arrange $test_brand = new Brand("Nike"); $test_brand->save(); $name = "House of Shoes and Waffles"; $address = "123 Street"; $phone = "4-44"; $test_store = new Store($name, $address, $phone); $test_store->save(); $name2 = "Bob's Shoe Palace"; $address2 = "456 Main Street"; $phone2 = "1-800-NEW-SHOE"; $test_store2 = new Store($name, $address, $phone); $test_store2->save(); //Act $test_brand->addStore($test_store); $test_brand->addStore($test_store2); //Assert $result = $test_brand->getStores(); $this->assertEquals([$test_store, $test_store2], $result); }
function testGetStores() { //Arrange $store_name = "Happy Lemon"; $test_store = new Store($store_name, $id = null); $test_store->save(); $store_name2 = "Chatime"; $test_store2 = new Store($store_name2, $id = null); $test_store2->save(); $brand_name = "Feiyue"; $test_brand = new Brand($brand_name, $id = null); $test_brand->save(); //Act $test_brand->addStore($test_store); $test_brand->addStore($test_store2); //Assert $this->assertEquals($test_brand->getStores(), [$test_store, $test_store2]); }
function test_addStore() { $test_name = "Helmut Lang"; $test_id = 1; $test_brand = new Brand($test_name, $test_id); $test_brand->save(); $store_name = "Nordstrom"; $test_store = new Store($store_name); $test_store->save(); $test_brand->addStore($test_store); $result = $test_brand->getStores(); $this->assertEquals([$test_store], $result); }
function testAddStore() { //Arrange $brand_name = "Sketchers"; $id = null; $test_brand = new Brand($brand_name, $id); $test_brand->save(); $store_name = "Norstrom"; $test_store = new Store($store_name, $id); $test_store->save(); //Act $test_brand->addStore($test_store); $result = $test_brand->getStores(); //Assert $this->assertEquals([$test_store], $result); }
function test_getStores() { //Arrange $store_name = "bobs shoes"; $test_store = new Store($store_name); $test_store->save(); $brand_name = "jerrys shoes "; $test_brand = new Brand($brand_name); $test_brand->save(); //Act $test_brand->addStore($test_store); $result = $test_brand->getStores(); //Assert $this->assertEquals([$test_store], $result); }