本文整理汇总了PHP中Brand::addStore方法的典型用法代码示例。如果您正苦于以下问题:PHP Brand::addStore方法的具体用法?PHP Brand::addStore怎么用?PHP Brand::addStore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Brand
的用法示例。
在下文中一共展示了Brand::addStore方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetStores
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);
}
示例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_brand->addStore($test_brand);
$test_brand->delete();
$this->assertEquals([], $test_brand->getStores());
}
示例3: Brand
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);
}
示例4: Store
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);
}
示例5: Brand
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]);
}
示例6: testGetStores
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);
}
示例7: Brand
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]);
}
示例8: 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]);
}
示例9: Brand
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);
}
示例10: testGetStores
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);
}
示例11: Brand
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);
}
示例12: testGetStores
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]);
}
示例13: testGetStores
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);
}
示例14: Brand
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]);
}
示例15: Brand
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);
}