本文整理汇总了PHP中Store::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Store::delete方法的具体用法?PHP Store::delete怎么用?PHP Store::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Store
的用法示例。
在下文中一共展示了Store::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Store
function test_delete()
{
$name = "Foot Locker";
$test_store = new Store($name, $id);
$test_store->save();
$name2 = "Foot Action";
$test_store2 = new Store($name2, $id);
$test_store2->save();
$test_store->delete();
$this->assertEquals([$test_store2], Store::getAll());
}
示例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());
}
示例3: testDeleteStore
function testDeleteStore()
{
//Arrange
$store_name = "Norstrom";
$id = null;
$test_store = new Store($store_name, $id);
$test_store->save();
$another_store = "Madewell";
$test_store2 = new Store($another_store, $id);
$test_store2->save();
//Act
$test_store->delete();
$result = Store::getAll();
//Assert
$this->assertEquals([$test_store2], $result);
}
示例4: testDelete
function testDelete()
{
//Arrange
$store_name = "Shoes Galore";
$test_store = new Store($store_name);
$test_store->save();
$store_name2 = "Save Our Soles";
$test_store2 = new Store($store_name);
$test_store2->save();
//Act
$test_store->delete();
$result = Store::getAll();
//Assert
$this->assertEquals([$test_store2], $result);
}
示例5: testDelete
function testDelete()
{
//Arrange
$store_name = "Chill N Fill";
$id = 1;
$category = "bar";
$region = "North Portland";
$address = "5215 N Lombard Portland, OR 97203";
$test_store = new Store($store_name, $category, $region, $address);
$test_store->save();
$beer_name = "Bike Beer";
$style = "Kolsch";
$abv = 5.6;
$ibu = 50;
$container = "Growler";
$brewery = "Hopworks";
$id = 1;
$image = "../img/test.jpg";
$test_beer = new Beer($beer_name, $style, $abv, $ibu, $container, $brewery, $image, $id);
$test_beer->save();
//Act
$test_store->addBeer($test_beer->getId());
$test_store->delete();
//Assert
$this->assertEquals([], $test_beer->getStores());
}
示例6: 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());
}
示例7: testDelete
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());
}
示例8: testDelete
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());
}
示例9: Store
function test_delete()
{
//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();
$retailer2 = "Macys";
$address2 = "400 SW 6th Avenue";
$phone2 = "888-888-8888";
$test_store2 = new Store($retailer2, $address2, $phone2, $id);
$test_store2->save();
//Act
$test_store->delete();
$result = Store::getAll();
//Assert
$this->assertEquals($test_store2, $result[0]);
}
示例10: json_encode
include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Store.php';
$action = "";
$store = new Store();
$response = array();
if (!empty($_GET['action'])) {
$action = strip_tags($_GET['action']);
}
switch ($action) {
case "login":
$data = $store->login();
break;
case "logout":
$data = $store->logout();
break;
case "add":
$data = $store->add();
break;
case "delete":
$data = $store->delete();
break;
case "edit":
$data = $store->edit();
break;
case "search":
$data = $store->search();
break;
default:
$data = array('success' => false, 'data' => array(), 'error' => array('warning' => 'Invalid action'));
break;
}
echo json_encode($data);
示例11: Store
function test_delete()
{
//Arrange
$store_name = "nike store ";
$test_store = new Store($store_name);
$test_store->save();
$store_name2 = "puma store ";
$test_store2 = new Store($store_name2);
$test_store2->save();
//Act
$test_store->delete();
$result = Store::getAll();
//Assert
$this->assertEquals([$test_store2], $result);
}
示例12: Store
function test_delete()
{
//Arrange
$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_store->delete();
$result = Store::getAll();
//Assert
$this->assertEquals([$test_store2], $result);
}
示例13: __setup_autoload_clear__
/**
* autoload キャッシュを削除する
**/
public static function __setup_autoload_clear__()
{
Store::delete(array(__DIR__, '__autoload'));
}
示例14: Store
function test_delete()
{
//Arrange
$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_store->delete();
//Assert
$result = Store::getAll();
$this->assertEquals($test_store2, $result[0]);
}
示例15: testDeleteJoins
function testDeleteJoins()
{
// Arrange
$name = "Get Your Kicks Co.";
$test_Store = new Store($name);
$test_Store->save();
$name = "Babbling Brooks";
$test_Brand = new Brand($name);
$test_Brand->save();
// Act
$test_Store->addBrand($test_Brand);
$test_Store->delete();
$result = $test_Brand->getStores();
// Assert
$this->assertEquals([], $result);
}