當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Store::getBrands方法代碼示例

本文整理匯總了PHP中Store::getBrands方法的典型用法代碼示例。如果您正苦於以下問題:PHP Store::getBrands方法的具體用法?PHP Store::getBrands怎麽用?PHP Store::getBrands使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Store的用法示例。


在下文中一共展示了Store::getBrands方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testAddBrand

 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]);
 }
開發者ID:jschold,項目名稱:shoe_stores,代碼行數:12,代碼來源:StoreTest.php

示例2: testDelete

 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());
 }
開發者ID:alexMcosta,項目名稱:Shoes_Brands,代碼行數:12,代碼來源:StoreTest.php

示例3: Brand

 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);
 }
開發者ID:bencasalino,項目名稱:shoe-store,代碼行數:15,代碼來源:StoreTest.php

示例4: Store

 function test_addBrand()
 {
     //Arrange
     $store_name = "Super Shoe Shopping Store";
     $test_store = new Store($store_name);
     $test_store->save();
     $brand_name = "Cool Shoes";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     //Act
     $test_store->addBrand($test_brand);
     //Assert
     $this->assertEquals($test_store->getBrands(), [$test_brand]);
 }
開發者ID:kevintokheim,項目名稱:Shoe_Store,代碼行數:14,代碼來源:StoreTest.php

示例5: Store

 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);
 }
開發者ID:CharlesAMoss,項目名稱:epic_Shoes,代碼行數:22,代碼來源:StoreTest.php

示例6: Store

 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);
 }
開發者ID:juliocesardiaz,項目名稱:Shoes,代碼行數:13,代碼來源:StoreTest.php

示例7: Store

 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);
 }
開發者ID:jcubed22,項目名稱:Shoes,代碼行數:24,代碼來源:StoreTest.php

示例8: testgetBrands

 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);
 }
開發者ID:bencasalino,項目名稱:cr4,代碼行數:23,代碼來源:StoreTest.php

示例9: testgetBrands

 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);
 }
開發者ID:kylepratuch,項目名稱:Shoe_Store,代碼行數:19,代碼來源:StoreTest.php

示例10: 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);
 }
開發者ID:alexdbrown,項目名稱:shoe_store,代碼行數:21,代碼來源:StoreTest.php

示例11: testGetBrands

 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);
 }
開發者ID:ben-pritchard,項目名稱:Epicodus-Assessment---PHP-Many-to-Many-in-Silex,代碼行數:19,代碼來源:storeTest.php

示例12: Store

 function test_removeBrands()
 {
     //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
     $test_store2->removeBrands();
     //Assert
     $result = $test_store2->getBrands();
     $this->assertEquals([], $result);
 }
開發者ID:ashlinaronin,項目名稱:shoes,代碼行數:32,代碼來源:StoreTest.php

示例13: testGetBrands

 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]);
 }
開發者ID:bdspen,項目名稱:ShoeStore,代碼行數:20,代碼來源:StoreTest.php

示例14: 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);
 }
開發者ID:jeffaustin81,項目名稱:shoe_store,代碼行數:17,代碼來源:StoreTest.php

示例15: Store

 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);
 }
開發者ID:r-hills,項目名稱:Shoes,代碼行數:19,代碼來源:StoreTest.php


注:本文中的Store::getBrands方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。