当前位置: 首页>>代码示例>>PHP>>正文


PHP Brand::getStores方法代码示例

本文整理汇总了PHP中Brand::getStores方法的典型用法代码示例。如果您正苦于以下问题:PHP Brand::getStores方法的具体用法?PHP Brand::getStores怎么用?PHP Brand::getStores使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Brand的用法示例。


在下文中一共展示了Brand::getStores方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Brand

 function test_removeStores()
 {
     //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
     $test_brand2->removeStores();
     //Assert
     $result = $test_brand2->getStores();
     $this->assertEquals([], $result);
 }
开发者ID:ashlinaronin,项目名称:shoes,代码行数:32,代码来源:BrandTest.php

示例2: function

$app->get("/brand_store", function () use($app) {
    return $app['twig']->render('brand_store.html.twig', array('brands' => Brand::getAll(), 'display_form' => false));
});
$app->post("/brand/{id}", function ($id) use($app) {
    $brand = Brand::find($id);
    $store = Store::find($_POST['store_id']);
    $brand->addStore($store);
    return $app['twig']->render('brand.html.twig', array('brands' => Brand::getAll(), 'brand_stores' => $brand->getStores(), 'display_form' => false, 'all_stores' => Store::getAll()));
});
$app->get("/brand_store_add_form", function () use($app) {
    return $app['twig']->render('brand_store.html.twig', array('brands' => Brand::getAll(), 'display_form' => true));
});
$app->post("/add_brand", function () use($app) {
    $brand = new Brand($_POST['brand_name']);
    $brand->save();
    return $app['twig']->render('brand.html.twig', array('brands' => Brand::getAll(), 'brand_stores' => $brand->getStores(), 'display_form' => false, 'all_stores' => Store::getAll()));
});
$app->get("/brand/{id}", function ($id) use($app) {
    $brand = Brand::find($id);
    return $app['twig']->render('brand.html.twig', array('brands' => Brand::getAll(), 'brand_stores' => $brand->getStores(), 'display_form' => false, 'all_stores' => Store::getAll()));
});
$app->post("/brands/{id}", function ($id) use($app) {
    $brand = Brand::find($id);
    $store = Store::find($_POST['store_id']);
    $brand->addStore($store);
    return $app['twig']->render('brand.html.twig', array('brand' => $brand, 'brand_stores' => $brand->getStores(), 'all_stores' => Store::getAll()));
});
$app->get("/store_brand", function () use($app) {
    return $app['twig']->render('store_brand.html.twig', array('stores' => Store::getAll(), 'display_form' => false));
});
$app->get("/stores_add_form", function () use($app) {
开发者ID:CharlesAMoss,项目名称:epic_Shoes,代码行数:31,代码来源:app.php

示例3: 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]);
 }
开发者ID:austinblanchard,项目名称:shoe_stores,代码行数:19,代码来源:BrandTest.php

示例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);
 }
开发者ID:jlbethel,项目名称:Shoes,代码行数:15,代码来源:BrandTest.php

示例5: 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]);
 }
开发者ID:kevintokheim,项目名称:Shoe_Store,代码行数:14,代码来源:BrandTest.php

示例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);
 }
开发者ID:ben-pritchard,项目名称:Epicodus-Assessment---PHP-Many-to-Many-in-Silex,代码行数:19,代码来源:brandTest.php

示例7: 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);
 }
开发者ID:alexdbrown,项目名称:shoe_store,代码行数:23,代码来源:BrandTest.php

示例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]);
 }
开发者ID:sammartinez,项目名称:Silex-Bootstrap,代码行数:26,代码来源:BrandTest.php

示例9: 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);
 }
开发者ID:jcubed22,项目名称:Shoes,代码行数:24,代码来源:BrandTest.php

示例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);
 }
开发者ID:anniehoogendoorn,项目名称:ShoeStores,代码行数:19,代码来源:BrandTest.php

示例11: 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]);
 }
开发者ID:bdspen,项目名称:ShoeStore,代码行数:20,代码来源:BrandTest.php

示例12: 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);
 }
开发者ID:bborealis,项目名称:shoes,代码行数:22,代码来源:BrandTest.php

示例13: 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]);
 }
开发者ID:nathanhwyoung,项目名称:shoe_stores,代码行数:21,代码来源:BrandTest.php

示例14: 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);
 }
开发者ID:CharlesAMoss,项目名称:epic_Shoes,代码行数:20,代码来源:BrandTest.php

示例15: testGetStores

 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);
 }
开发者ID:CaseyH33,项目名称:Shoes,代码行数:20,代码来源:BrandTest.php


注:本文中的Brand::getStores方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。