Exemplo n.º 1
0
 function testUpdate()
 {
     $store_name = "Beacons Closet";
     $new_store = new Store($store_name);
     $new_store->save();
     $new_store->setStoreName("Buffalo Exchange");
     $new_store->update();
     $result = Store::getAll();
     $this->assertEquals($new_store, $result[0]);
 }
Exemplo n.º 2
0
 function test_update()
 {
     $test_name = "Nordstrom";
     $test_id = 1;
     $test_store = new Store($test_name, $test_id);
     $test_store->save();
     $new_name = "Bloomingdales";
     $test_store->update($new_name);
     $result = Store::getAll();
     $this->assertEquals($new_name, $result[0]->getName());
 }
Exemplo n.º 3
0
 function testUpdate()
 {
     //Arrange
     $store_name = "Portland Running Company";
     $id = 1;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $new_store_name = "New Balance";
     //Act
     $test_store->update($new_store_name);
     //Assert
     $this->assertEquals($new_store_name, $test_store->getStoreName());
 }
 function testUpdate()
 {
     // Arrange
     $name = "Get Your Kicks Co.";
     $test_Store = new Store($name);
     $test_Store->save();
     $new_name = "Get Your Kicks Yo";
     // Act
     $test_Store->update($new_name);
     $result = $test_Store->getName();
     // Assert
     $this->assertEquals($new_name, $result);
 }
Exemplo n.º 5
0
 function testUpdate()
 {
     //Arrange
     $id = null;
     $store_name = "Nike";
     $test_store = new Store($id, $store_name);
     $test_store->save();
     $new_store_name = "Camera World";
     //Act
     $test_store->update($new_store_name);
     //Assert
     $this->assertEquals($test_store->getStoreName(), $new_store_name);
 }
Exemplo n.º 6
0
 function test_update()
 {
     //Arrange
     $store_name = "PLZ BUY SHOES HERE";
     $id = 1;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $new_store_name = "KOOL SHOES HERE";
     //Act
     $test_store->update($new_store_name);
     //Assert
     $this->assertEquals("KOOL SHOES HERE", $test_store->getStoreName());
 }
Exemplo n.º 7
0
 function testUpdate()
 {
     //Arrange
     $id = null;
     $store_name = "Footlocker";
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $new_store_name = "Foot locker";
     //Act
     $test_store->update($new_store_name);
     //Assert
     $result = $test_store->getStoreName();
     $this->assertEquals($new_store_name, $result);
 }
Exemplo n.º 8
0
function store_edit()
{
    $store = new Store();
    $storeid = isset($_POST['storeid']) ? $_POST['storeid'] : "";
    $store->id = $storeid;
    $store->name = isset($_POST['name']) ? $_POST['name'] : "";
    $store->address = isset($_POST['address']) ? $_POST['address'] : "";
    $store->contact = isset($_POST['contact']) ? $_POST['contact'] : "";
    $store->phone = isset($_POST['phone']) ? $_POST['phone'] : "";
    $store->active = isset($_POST['active']) ? 1 : 0;
    $store->fax = isset($_POST['fax']) ? $_POST['fax'] : "";
    $store->email = isset($_POST['email']) ? $_POST['email'] : "";
    $store->description = isset($_POST['description']) ? $_POST['description'] : "";
    if ($storeid == "new") {
        if ($store->add()) {
            header("location: index.php?pages=store_detail&store={$store->id}");
            exit;
        }
    } else {
        return $store->update();
    }
    return false;
}
Exemplo n.º 9
0
 function test_update()
 {
     //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();
     $new_retailer = "Macys";
     $new_address = "400 SW 6th Avenue";
     $new_phone = "888-888-8888";
     //Act
     $test_store->update($new_retailer, $new_address, $new_phone);
     //Assert
     $this->assertEquals($new_retailer, $test_store->getRetailer());
     $this->assertEquals($new_address, $test_store->getAddress());
     $this->assertEquals($new_phone, $test_store->getPhone());
 }
Exemplo n.º 10
0
 function test_store_update()
 {
     //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();
     $new_name = "Foot Action";
     //Act
     $test_store->update($new_name);
     //Assert
     $this->assertEquals($new_name, $test_store->getStoreName());
 }
Exemplo n.º 11
0
 function test_updateLocation()
 {
     //Arrange
     $name = "The Shoe Store";
     $location = "432 SW Tootsies Ave";
     $phone = "503-555-5555";
     $test_store = new Store($name, $location, $phone);
     $test_store->save();
     $column_to_update = "location";
     $new_info = "100 Whatever Lane";
     //Act
     $test_store->update($column_to_update, $new_info);
     //Assert
     $result = Store::getAll();
     $this->assertEquals("100 Whatever Lane", $result[0]->getLocation());
 }
Exemplo n.º 12
0
 function testUpdate()
 {
     //Arrange
     $store_name = "Shoes Galore";
     $test_store = new Store($store_name);
     $test_store->save();
     $new_store_name = "Save Our Soles";
     //Act
     $test_store->update($new_store_name);
     $result = $test_store->getStoreName();
     //Assert
     $this->assertEquals("Save Our Soles", $result);
 }
Exemplo n.º 13
0
 function testUpdate()
 {
     //Arrange
     $store_name = "Norstrom";
     $id = null;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $new_name = "Ikea";
     //Act
     $test_store->update($new_name);
     //Assert
     $this->assertEquals($new_name, $test_store->getStoreName());
 }
Exemplo n.º 14
0
 function test_update()
 {
     //Arrange
     $store_name = "The Foot Store";
     $test_store = new Store($store_name);
     $test_store->save();
     //Act
     $new_store_name = "The Store of Feet";
     $test_store->update($new_store_name);
     //Assert
     $this->assertEquals("The Store of Feet", $test_store->getStoreName());
 }
Exemplo n.º 15
0
 function testUpdate()
 {
     //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, $id);
     $test_store->save();
     $new_store_name = "Fill N Chill";
     $new_category = "bottleshop";
     $new_region = "SW Portland";
     $new_address = "5215 N Chautauqua Blvd Portland, OR 97203";
     //Act
     $test_store->update($new_store_name, $new_category, $new_region, $new_address);
     //Assert
     $this->assertEquals("Fill N Chill", $test_store->getStoreName());
     $this->assertEquals("bottleshop", $test_store->getCategory());
     $this->assertEquals("SW Portland", $test_store->getRegion());
     $this->assertEquals("5215 N Chautauqua Blvd Portland, OR 97203", $test_store->getAddress());
 }
Exemplo n.º 16
0
 function testUpdate()
 {
     //Arrange
     $store_name = "Happy Lemon";
     $id = 1;
     $test_store = new Store($store_name, $id);
     $test_store->save();
     $new_store_name = "Chatime";
     //Act
     $test_store->update($new_store_name);
     //Assert
     $this->assertEquals($new_store_name, $test_store->getStoreName());
 }
Exemplo n.º 17
0
 function testUpdate()
 {
     //Arrange
     $name = "Shoe Store 1";
     $test_store = new Store($name);
     $test_store->save();
     $new_name = "Shoe Store 2";
     //Act
     $test_store->update($new_name);
     $result = $test_store->getName();
     //Assert
     $this->assertEquals($new_name, $result);
 }
Exemplo n.º 18
0
 function testUpdate()
 {
     //Arrange
     $name = "Clogs-N-More";
     $id = 1;
     $test_store = new Store($name, $id);
     $test_store->save();
     $new_name = "Shoe Depot";
     //Act
     $test_store->update($new_name);
     //Assert
     $this->assertEquals("Shoe Depot", $test_store->getName());
 }
Exemplo n.º 19
0
 function testUpdate()
 {
     //Arrange
     $store_location = "Lloyd Center";
     $test_store = new Store($store_location);
     $test_store->save();
     $new_store_location = "Hawthorn";
     //Act
     $test_store->update($new_store_location);
     //Assert
     $this->assertEquals("Hawthorn", $test_store->getStoreLocation());
 }