コード例 #1
0
ファイル: StoreTest.php プロジェクト: jschold/shoe_stores
 function testAddBrand()
 {
     $store_name = "Beacons Closet";
     $new_store = new Store($store_name);
     $new_store->save();
     $brand_name = "dr.martens";
     $new_brand = new Brand($brand_name);
     $new_brand->save();
     $new_store->addBrand($new_brand);
     $result = $new_store->getBrands();
     $this->assertEquals($new_brand, $result[0]);
 }
コード例 #2
0
ファイル: StoreTest.php プロジェクト: alexMcosta/Shoes_Brands
 function testDelete()
 {
     $name = "Zelds";
     $test_store = new Store($name);
     $test_store->save();
     $name = "Granite";
     $test_brand = new Brand($name);
     $test_brand->save();
     $test_store->addBrand($test_brand);
     $test_store->delete();
     $this->assertEquals([], $test_store->getBrands());
 }
コード例 #3
0
ファイル: StoreTest.php プロジェクト: bencasalino/shoe-store
 function test_getBrands()
 {
     //Arrange
     $brand_name = "nike";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     $store_name = "joes sandal store ";
     $test_store = new Store($store_name);
     $test_store->save();
     //Act
     $test_store->addBrand($test_brand);
     $result = $test_store->getBrands();
     //Assert
     $this->assertEquals([$test_brand], $result);
 }
コード例 #4
0
ファイル: StoreTest.php プロジェクト: kevintokheim/Shoe_Store
 function test_delete()
 {
     //Arrange
     $store_name = "The Awesome Shoe Store";
     $test_store = new Store($store_name);
     $test_store->save();
     $brand_name = "Nike";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     //Act
     $test_store->addBrand($test_brand);
     $test_store->delete();
     //Assert
     $this->assertEquals([], $test_brand->getStores());
 }
コード例 #5
0
ファイル: StoreTest.php プロジェクト: CharlesAMoss/epic_Shoes
 function test_store_getBrands()
 {
     //Arrange
     $store_name = "Goody New Shoes";
     $id = 1;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $brand_name = "Nike";
     $id1 = 1;
     $test_brand = new Brand($brand_name, $id1);
     $test_brand->save();
     $test_store->addBrand($test_brand);
     $brand_name2 = "Converse";
     $id2 = 2;
     $test_brand2 = new Brand($brand_name2, $id2);
     $test_brand2->save();
     $test_store->addBrand($test_brand2);
     //Act
     $result = $test_store->getBrands();
     //Assert
     $this->assertEquals([$test_brand2, $test_brand], $result);
 }
コード例 #6
0
ファイル: StoreTest.php プロジェクト: juliocesardiaz/Shoes
 function test_addBrand()
 {
     $test_name = "Nordstrom";
     $test_id = 1;
     $test_store = new Store($test_name, $test_id);
     $test_store->save();
     $brand_name = "Y-3";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     $test_store->addBrand($test_brand);
     $result = $test_store->getBrands();
     $this->assertEquals([$test_brand], $result);
 }
コード例 #7
0
ファイル: StoreTest.php プロジェクト: jcubed22/Shoes
 function test_getBrands()
 {
     //Arrange
     $retailer = "Nordstrom";
     $address = "1234 SW Main Street";
     $phone = "123-456-7890";
     $id = null;
     $test_store = new Store($retailer, $address, $phone, $id);
     $test_store->save();
     $name = "Nike";
     $stock = 5;
     $test_brand = new Brand($name, $stock, $id);
     $test_brand->save();
     $name2 = "Adidas";
     $stock2 = 8;
     $test_brand2 = new Brand($name2, $stock2, $id);
     $test_brand2->save();
     //Act
     $test_store->addBrand($test_brand);
     $test_store->addBrand($test_brand2);
     $result = $test_store->getBrands();
     //Assert
     $this->assertEquals([$test_brand, $test_brand2], $result);
 }
コード例 #8
0
ファイル: StoreTest.php プロジェクト: bencasalino/cr4
 function testgetBrands()
 {
     //Arrange
     $name1 = "shoe store";
     $location = "123 n fake dr";
     $id1 = 4;
     $test_store = new Store($name1, $location, $id1);
     $test_store->save();
     $name = "nike";
     $id = 1;
     $test_brand = new Brand($name, $id);
     $test_brand->save();
     $name2 = "addidas";
     $id2 = 2;
     $test_brand2 = new Brand($name2, $id2);
     $test_brand2->save();
     //Act
     $test_store->addBrand($test_brand);
     $test_store->addBrand($test_brand2);
     $result = $test_store->getBrands();
     //Assert
     $this->assertEquals([$test_brand, $test_brand2], $result);
 }
コード例 #9
0
ファイル: StoreTest.php プロジェクト: kylepratuch/Shoe_Store
 function testgetBrands()
 {
     //Arrange
     $store_name = "Shoes Galore";
     $test_store = new Store($store_name);
     $test_store->save();
     $brand_name = "Super Kicks";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     $brand_name2 = "Cool Shoes";
     $test_brand2 = new Brand($brand_name2);
     $test_brand2->save();
     //Act
     $test_store->addBrand($test_brand);
     $test_store->addBrand($test_brand2);
     $result = $test_store->getBrands();
     //Assert
     $this->assertEquals([$test_brand, $test_brand2], $result);
 }
コード例 #10
0
ファイル: StoreTest.php プロジェクト: alexdbrown/shoe_store
 function test_getBrands()
 {
     //Arrange
     $name = "The Shoe Store";
     $location = "432 SW Tootsies Ave";
     $phone = "503-555-5555";
     $test_store = new Store($name, $location, $phone);
     $test_store->save();
     $name = "Crocs";
     $test_brand = new Brand($name);
     $test_brand->save();
     $name2 = "Doc Martins";
     $test_brand2 = new Brand($name);
     $test_brand2->save();
     //Act
     $test_store->addBrand($test_brand);
     $test_store->addBrand($test_brand2);
     //Assert
     $result = $test_store->getBrands();
     $this->assertEquals([$test_brand, $test_brand2], $result);
 }
 function testGetBrands()
 {
     // Arrange
     $brand_name = "Babbling Brooks";
     $test_Brand = new Brand($brand_name);
     $test_Brand->save();
     $brand_name2 = "Old Balance";
     $test_Brand2 = new Brand($brand_name2);
     $test_Brand2->save();
     $store_name = "I Wanna Run Fast Co.";
     $test_Store = new Store($store_name);
     $test_Store->save();
     // Act
     $test_Store->addBrand($test_Brand);
     $test_Store->addBrand($test_Brand2);
     $result = $test_Store->getBrands();
     // Assert
     $this->assertEquals([$test_Brand, $test_Brand2], $result);
 }
コード例 #12
0
ファイル: StoreTest.php プロジェクト: ashlinaronin/shoes
 function test_hasBrand()
 {
     //Arrange
     // 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();
     // 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();
     // Add both brands to second store
     $test_store2->addBrand($test_brand);
     $test_store2->addBrand($test_brand2);
     //Act
     $true_result = $test_store2->hasBrand($test_brand2->getId());
     $false_result = $test_store->hasBrand($test_brand2->getId());
     //Assert
     $this->assertEquals(true, $true_result);
     $this->assertEquals(false, $false_result);
 }
コード例 #13
0
ファイル: StoreTest.php プロジェクト: jlbethel/Shoes
 function test_getBrands()
 {
     //Arrange
     $brand_name = "La Sportiva";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     $store_name = "Shoe World";
     $test_store = new Store($store_name);
     $test_store->save();
     //Act
     $test_store->addBrand($test_brand);
     $result = $test_store->getBrands();
     //Assert
     $this->assertEquals([$test_brand], $result);
 }
コード例 #14
0
ファイル: StoreTest.php プロジェクト: bdspen/ShoeStore
 function testGetBrands()
 {
     $name = "ShoeStore";
     $id = 1;
     $test_store = new Store($name, $id);
     $test_store->save();
     $name = "Asics";
     $id3 = 3;
     $test_brand = new Brand($name, $id3);
     $test_brand->save();
     $name2 = "Nike";
     $id2 = 2;
     $test_brand2 = new Brand($name2, $id2);
     $test_brand2->save();
     //Act
     $test_store->addBrand($test_brand);
     $test_store->addBrand($test_brand2);
     //Assert
     $this->assertEquals($test_store->getBrands(), [$test_brand, $test_brand2]);
 }
コード例 #15
0
ファイル: StoreTest.php プロジェクト: jeffaustin81/shoe_store
 function test_deleteAllbrands()
 {
     $name = "Foot Locker";
     $test_store = new Store($name, $id);
     $test_store->save();
     $name = "Nike";
     $test_brand = new Brand($name, $id);
     $test_brand->save();
     $name2 = "Adidas";
     $test_brand2 = new Brand($name2, $id);
     $test_brand2->save();
     $test_store->addBrand($test_brand->getId());
     $test_store->addBrand($test_brand2->getId());
     $test_store->deleteAllBrands();
     $result = $test_store->getBrands();
     $this->assertEquals([], $result);
 }
コード例 #16
0
ファイル: StoreTest.php プロジェクト: r-hills/Shoes
 function test_getBrands()
 {
     //Arrange
     $name = "House of Shoes and Waffles";
     $address = "123 Street";
     $phone = "4-44";
     $test_store = new Store($name, $address, $phone);
     $test_store->save();
     $test_brand = new Brand("Nike");
     $test_brand->save();
     $test_brand2 = new Brand("Adidas");
     $test_brand2->save();
     //Act
     $test_store->addBrand($test_brand);
     $test_store->addBrand($test_brand2);
     //Assert
     $result = $test_store->getBrands();
     $this->assertEquals([$test_brand, $test_brand2], $result);
 }
コード例 #17
0
 function test_getBrands()
 {
     //Arrange
     $store_name = "HERE IS A BIG SHOE STORE";
     $id = 1;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $brand_name = "BRAH-DIDAS";
     $id2 = 2;
     $test_brand = new Brand($brand_name, $id2);
     $test_brand->save();
     $brand_name2 = "K-SWISS-CHEESE";
     $id2 = 3;
     $test_brand2 = new Brand($brand_name2, $id2);
     $test_brand2->save();
     //Act
     $test_store->addBrand($test_brand);
     $test_store->addBrand($test_brand2);
     //Assert
     $this->assertEquals($test_store->getBrands(), [$test_brand, $test_brand2]);
 }
コード例 #18
0
ファイル: StoreTest.php プロジェクト: sammartinez/shoes
 function test_getBrands()
 {
     //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_store->addBrand($test_brand);
     $test_store->addBrand($test_brand2);
     $test_store2->addBrand($test_brand2);
     //Assert
     $this->assertEquals($test_store->getBrands(), [$test_brand, $test_brand2]);
 }
コード例 #19
0
 function test_getBrands()
 {
     //Arrange
     $brand_name = "Puma";
     $id = null;
     $test_brand = new Brand($brand_name, $id);
     $test_brand->save();
     $brand_name2 = "Adidas";
     $test_brand2 = new Brand($brand_name2, $id);
     $test_brand2->save();
     $store_name = "Footlocker";
     $test_store = new Store($store_name, $id);
     $test_store->save();
     //Act
     $test_store->addBrand($test_brand->getId());
     $test_store->addBrand($test_brand2->getId());
     //Assert
     $this->assertEquals($test_store->getBrands(), [$test_brand, $test_brand2]);
 }
コード例 #20
0
 function testGetBrands()
 {
     //Arrange
     $name = "Shoe Store 1";
     $test_store = new Store($name);
     $test_store->save();
     $brand_name = "Brand name 1";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     $brand_name2 = "Brand name 2";
     $test_brand2 = new Brand($brand_name2);
     $test_brand2->save();
     //Act
     $test_store->addBrand($test_brand);
     $test_store->addBrand($test_brand2);
     $result = $test_store->getBrands();
     //Assert
     $this->assertEquals([$test_brand, $test_brand2], $result);
 }
コード例 #21
0
ファイル: StoreTest.php プロジェクト: bborealis/shoes
 function testDelete()
 {
     //Arrange
     $name = "Clogs-N-More";
     $id = 1;
     $test_store = new Store($name, $id);
     $test_store->save();
     $name = "Nike";
     $id = 1;
     $test_brand = new Brand($name, $id);
     $test_brand->save();
     //Act
     $test_store->addBrand($test_brand);
     $test_store->delete();
     //Assert
     $this->assertEquals([], $test_brand->getStores());
 }
コード例 #22
0
 function testGetStores()
 {
     //Arrange
     $brand_name = "Sketchers";
     $id = null;
     $test_brand = new Brand($brand_name, $id);
     $test_brand->save();
     $another_brand = "Doc Martin";
     $test_brand2 = new Brand($another_brand, $id);
     $test_brand2->save();
     $store_name = "Norstrom";
     $test_store = new Store($store_name, $id);
     $test_store->save();
     //Act
     $test_store->addBrand($test_brand);
     $test_store->addBrand($test_brand2);
     $result = $test_store->getBrands();
     //Assert
     $this->assertEquals([$test_brand, $test_brand2], $result);
 }
コード例 #23
0
ファイル: StoreTest.php プロジェクト: slmaturen/shoe_store
 function testDelete()
 {
     //Arrange
     $store_name = "Happy Lemon";
     $id = 1;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $brand_name = "Feiyue";
     $id2 = 2;
     $test_brand = new Brand($brand_name, $id2);
     $test_brand->save();
     //Act
     $test_store->addBrand($test_brand);
     $test_store->delete();
     //Assert
     $this->assertEquals([], $test_brand->getStores());
 }