Example #1
0
 function testGetStores()
 {
     $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();
     $brand_name = "dr.martens";
     $new_brand = new Brand($brand_name);
     $new_brand->save();
     $new_brand->addStore($new_store);
     $new_brand->addStore($new_store2);
     var_dump($new_brand);
     $result = $new_brand->getStores();
     var_dump($result);
     $this->assertEquals([$new_store, $new_store2], $result);
 }
Example #2
0
 function testDelete()
 {
     $name = "Zelds";
     $test_store = new Store($name);
     $test_store->save();
     $name = "Granite";
     $test_brand = new Brand($name);
     $test_brand->save();
     $test_brand->addStore($test_brand);
     $test_brand->delete();
     $this->assertEquals([], $test_brand->getStores());
 }
Example #3
0
 function test_hasStore()
 {
     //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
     $true_result = $test_brand2->hasStore($test_store2->getId());
     $false_result = $test_brand->hasStore($test_store2->getId());
     //Assert
     $this->assertEquals(true, $true_result);
     $this->assertEquals(false, $false_result);
 }
Example #4
0
 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_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 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);
 }
Example #7
0
 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 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]);
 }
Example #9
0
 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);
 }
Example #10
0
 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);
 }
Example #11
0
 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);
 }
Example #12
0
 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]);
 }
Example #13
0
 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);
 }
Example #14
0
 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]);
 }
Example #15
0
 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);
 }
Example #16
0
 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);
 }
Example #17
0
 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);
 }
Example #18
0
 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);
 }
Example #19
0
 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);
 }
Example #20
0
 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);
 }
Example #21
0
 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]);
 }
Example #22
0
 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);
 }
Example #23
0
 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);
 }
Example #24
0
 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);
 }