Esempio n. 1
0
 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());
 }
Esempio n. 2
0
 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());
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 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());
 }
Esempio n. 6
0
 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());
 }
Esempio n. 7
0
 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());
 }
Esempio n. 8
0
 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());
 }
Esempio n. 9
0
 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]);
 }
Esempio n. 10
0
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);
Esempio n. 11
0
 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);
 }
Esempio n. 12
0
 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);
 }
Esempio n. 13
0
 /**
  * autoload キャッシュを削除する
  **/
 public static function __setup_autoload_clear__()
 {
     Store::delete(array(__DIR__, '__autoload'));
 }
Esempio n. 14
0
 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]);
 }
 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);
 }
Esempio n. 16
0
 function test_delete()
 {
     //Arrange
     $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();
     //Act
     $test_store->delete();
     //Assert
     $result = Store::getAll();
     $this->assertEquals([$test_store2], $result);
 }
Esempio n. 17
0
 function test_store_delete()
 {
     //Arrange
     $store_name2 = "Goody New Shoes";
     $test_store2 = new Store($store_name2);
     $test_store2->save();
     $store_name = "Groos Shoes";
     $test_store = new Store($store_name);
     $test_store->save();
     //Act
     $test_store->delete();
     //Assert
     $result = Store::getAll();
     $this->assertEquals([$test_store2], Store::getAll());
 }
Esempio n. 18
0
 protected function __after_save__($commit)
 {
     Store::delete(self::cache_key($this->id));
 }
Esempio n. 19
0
 /**
  * 删除用户的网关地址
  * @param int $uid
  */
 public static function deleteUidAddress($uid)
 {
     return Store::delete($uid);
 }
Esempio n. 20
0
 function test_delete()
 {
     //Arrange
     $id = null;
     $store_name = "New Seasons";
     $test_store = new Store($id, $store_name);
     $test_store->save();
     $id2 = null;
     $store_name2 = "Whole Foods";
     $test_store2 = new Store($id2, $store_name2);
     $test_store2->save();
     //Act
     $test_store->delete();
     $result = Store::getAll();
     //Assert
     $this->assertEquals($test_store2, $result[0]);
 }
Esempio n. 21
0
 function test_deleteStore()
 {
     //Arrange
     $store_name = "CLOTHES FOR YOUR FEET";
     $id = 1;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $store_name2 = "John Franti and his Foot Fellowship";
     $id2 = 2;
     $test_store2 = new Store($store_name2, $id2);
     $test_store2->save();
     //Act
     $test_store->delete();
     //Assert
     $this->assertEquals([$test_store2], Store::getAll());
 }
Esempio n. 22
0
 function testDelete()
 {
     //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();
     //Act
     $test_store->delete();
     $result = Store::getAll();
     //Assert
     $this->assertEquals([$test_store2], $result);
 }
Esempio n. 23
0
 function testDeleteStore()
 {
     //Arrange
     $id = null;
     $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_store->delete();
     //Assert
     $result = Store::getAll();
     $this->assertEquals([$test_store2], $result);
 }
Esempio n. 24
0
 /**
  * @see vendors/org/rhaco/storage/db/Dao/Dao#__after_save__()
  * @const string $svn_passwd_file リポジトリにアクセスするパスワード
  */
 protected function __after_save__($commit)
 {
     $template = new Template();
     $template->vars('maintainers', C(OpenpearMaintainer)->find_all());
     File::write(OpenpearConfig::svn_passwd_file(work_path('openpear.passwd')), $template->read('files/passwd.txt'));
     Store::delete(self::cache_key($this->id));
 }
Esempio n. 25
0
 protected function __after_save__()
 {
     foreach (array($this->maintainer_to_id, $this->maintainer_from_id) as $id) {
         Store::delete(array('openpear_message_unread', $id));
     }
 }