Exemplo n.º 1
0
 function test_deleteAll()
 {
     //Arrange
     $store_name = "Flying Shoes";
     $test_store = new Store($store_name);
     $test_store->save();
     //Act
     Store::deleteAll();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
Exemplo n.º 2
0
 function testDeleteAll()
 {
     //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();
     //Assert
     Store::deleteAll();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
Exemplo n.º 3
0
 function testDeleteAll()
 {
     //Arrange
     $store_name = "Shoes Galore";
     $test_store = new Store($store_name);
     $test_store->save();
     $store_name2 = "Save Our Soles";
     $test_store2 = new Store($store_name);
     $test_store2->save();
     //Act
     Store::deleteAll();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
Exemplo n.º 4
0
 function test_store_deleteAll()
 {
     //Arrange
     $store_name2 = "Goody New Shoes";
     $test_store2 = new Store($store_name2);
     $test_store2->save();
     $store_name = "Groos Shoes";
     $test_store = new Store($store_name);
     $test_store->save();
     //Act
     Store::deleteAll();
     //Assert
     $result = Store::getAll();
     $this->assertEquals([], $result);
 }
Exemplo n.º 5
0
 function testDeleteAll()
 {
     //Arrange
     $store_location = "Lloyd Center";
     $id = 1;
     $test_store = new Store($store_location, $id);
     $store_location2 = "Pioneer Place";
     $id2 = 2;
     $test_store2 = new Store($store_location2, $id2);
     //Act
     Store::deleteAll();
     //Assert
     $result = Store::getALl();
     $this->assertEquals([], $result);
 }
Exemplo n.º 6
0
 function testDeleteAll()
 {
     //Arrange
     $store_name = "Norstrom";
     $id = null;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $another_store = "Madewell";
     $test_store2 = new Store($another_store, $id);
     $test_store2->save();
     //Act
     Store::deleteAll();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
Exemplo n.º 7
0
 function testDeleteAll()
 {
     //Arrange
     $id = null;
     $store_name = "Nike";
     $test_store = new Store($id, $store_name);
     $test_store->save();
     $store_name2 = "Poler";
     $test_store2 = new Store($id, $store_name);
     $test_store2->save();
     //Act
     Store::deleteAll();
     //Assert
     $result = Store::getAll();
     $this->assertEquals([], $result);
 }
Exemplo n.º 8
0
 function testDeleteAll()
 {
     //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();
     //Act
     Store::deleteAll();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
Exemplo n.º 9
0
 function test_deleteAll()
 {
     //Arrange
     $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();
     //Act
     Store::deleteAll();
     //Assert
     $result = Store::getAll();
     $this->assertEquals([], $result);
 }
Exemplo n.º 10
0
 protected function tearDown()
 {
     Store::deleteAll();
     Brand::deleteAll();
     $GLOBALS['DB']->exec("DELETE FROM availability;");
 }
Exemplo n.º 11
0
 protected function tearDown()
 {
     Beer::deleteAll();
     Store::deleteAll();
 }
Exemplo n.º 12
0
 function testDeleteAll()
 {
     //Arrange
     $name = "shoe store";
     $location = "1234 nw 1st street";
     $id = 4;
     $test_store = new Store($name, $location, $id);
     $test_store->save();
     $name2 = "other store";
     $location2 = "5555 sw 2nd street";
     $id2 = 3;
     $test_store2 = new Store($name2, $location2, $id2);
     $test_store2->save();
     //Act
     Store::deleteAll();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
Exemplo n.º 13
0
 function test_deleteAll()
 {
     //Arrange
     $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
     Store::deleteAll();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
 function testDeleteAll()
 {
     // Arrange
     $name = "Get Your Kicks Co.";
     $test_Store = new Store($name);
     $test_Store->save();
     $name2 = "I Wanna Run Fast Co.";
     $test_Store2 = new Store($name2);
     $test_Store2->save();
     // Act
     Store::deleteAll();
     $result = Store::getAll();
     // Assert
     $this->assertEquals([], $result);
 }
Exemplo n.º 15
0
 protected function tearDown()
 {
     Store::deleteAll();
     Brand::deleteAll();
 }
Exemplo n.º 16
0
 function testDeleteAll()
 {
     $store_name = "Beacons Closet";
     $new_store = new Store($store_name);
     $new_store->save();
     $store_name2 = "Buffalo Exchange";
     $new_store2 = new Store($store_name);
     $new_store2->save();
     Store::deleteAll();
     $result = Store::getAll();
     $this->assertEquals([], $result);
 }
Exemplo n.º 17
0
 function testDeleteAll()
 {
     //Arrange
     $store_name = "Happy Lemon";
     $id = 1;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $store_name2 = "Chatime";
     $id2 = 2;
     $test_store2 = new Store($store_name2, $id2);
     $test_store2->save();
     //Act
     Store::deleteAll();
     //Assert
     $result = Store::getAll();
     $this->assertEquals([], $result);
 }
Exemplo n.º 18
0
 function testDeleteAll()
 {
     //Arrange
     $store_name = "Chill N Fill";
     $id = 1;
     $category = "bar";
     $region = "North Portland";
     $address = "5215 N Lombard Portland, OR 97203";
     $test_store = new Store($store_name, $category, $region, $address, $id);
     $test_store->save();
     $store_name2 = "Growler Guys";
     $id2 = 1;
     $category2 = "bottle shop";
     $region2 = "NE Portland";
     $address2 = "5553 N Lombard Portland, OR 97444";
     $test_store2 = new Store($store_name2, $category2, $region2, $address2, $id2);
     $test_store2->save();
     //Act
     Store::deleteAll();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
Exemplo n.º 19
0
 function test_deleteAll()
 {
     //Arrange
     $store_name = "SMALL SHOE STORE";
     $id = 1;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $store_name2 = "SMALLER SHOE STORE";
     $id2 = 2;
     $test_store2 = new Store($store_name2, $id2);
     $test_store2->save();
     //Act
     Store::deleteAll();
     //Assert
     $result = Store::getAll();
     $this->assertEquals([], $result);
 }
Exemplo n.º 20
0
 function test_deleteAll()
 {
     $name = "Foot Locker";
     $test_store = new Store($name);
     $test_store->save();
     $name2 = "Foot Action";
     $test_store2 = new Store($name2);
     $test_store2->save();
     Store::deleteAll();
     $result = Store::getAll();
     $this->assertEquals([], $result);
 }
Exemplo n.º 21
0
 function test_deleteAll()
 {
     $store_name = "Shoe World";
     $test_store = new Store($store_name);
     $test_store->save();
     $store_name2 = "Shoe Deopt";
     $test_store2 = new Store($store_name2);
     $test_store2->save();
     //Act
     Store::deleteAll();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
Exemplo n.º 22
0
 function test_deleteAll()
 {
     $store_name = "george shoe store ";
     $test_store = new Store($store_name);
     $test_store->save();
     $store_name2 = "kramer shoe store ";
     $test_store2 = new Store($store_name2);
     $test_store2->save();
     //Act
     Store::deleteAll();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([], $result);
 }
Exemplo n.º 23
0
 protected function tearDown()
 {
     Store::deleteAll();
     Brand::deleteAll();
     $GLOBALS['DB']->exec("DELETE FROM brands_stores;");
 }
Exemplo n.º 24
0
 function test_deleteAll()
 {
     //arrange
     $name = "Shoe Shoe";
     $id = 1;
     $test_store1 = new Store($name, $id);
     $test_store1->save();
     //act
     $name2 = "Blue Shoe";
     $id2 = 2;
     $test_store2 = new Store($name2, $id2);
     $test_store2->save();
     Store::deleteAll();
     $result = Store::getAll();
     //assert
     $this->assertEquals([], $result);
 }
Exemplo n.º 25
0
    $brand = new Brand($_POST['brand_name']);
    $brand->save();
    return $app['twig']->render('brands.html.twig', array('brands' => Brand::getAll()));
});
//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']);
Exemplo n.º 26
0
 function test_deleteAll()
 {
     //Arrange
     $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
     Store::deleteAll();
     //Assert
     $result = Store::getAll();
     $this->assertEquals([], $result);
 }