Exemplo n.º 1
0
 function testUpdate()
 {
     $brand_name = "dr.martens";
     $new_brand = new Brand($brand_name);
     $new_brand->save();
     $new_brand->setBrandName("doc martens");
     $new_brand->update();
     $result = Brand::getAll();
     $this->assertEquals($new_brand, $result[0]);
 }
Exemplo n.º 2
0
 function testSetBrandName()
 {
     //Arrange
     $brand_name = "Feiyue";
     $test_brand = new Brand($brand_name);
     //Act
     $test_brand->setBrandName($brand_name);
     $result = $test_brand->getBrandName();
     //Assert
     $this->assertEquals($brand_name, $result);
 }
Exemplo n.º 3
0
 function test_setBrandName()
 {
     //Arrange
     $brand_name = "Nike";
     $test_brand = new Brand($brand_name);
     //Act
     $test_brand->setBrandName("Nike");
     $result = $test_brand->getBrandName();
     //Assert
     $this->assertEquals("Nike", $result);
 }
Exemplo n.º 4
0
 public function executeAddBrand(sfWebRequest $request)
 {
     try {
         $q = new Brand();
         $q->setBrandName($request->getParameter('brand_name'));
         $q->save();
         $this->res = "Brand Added!";
     } catch (Exception $exc) {
         $this->res = $exc->getMessage();
     }
 }
Exemplo n.º 5
0
 function test_brand_set()
 {
     //Arrange
     $brand_name = "Converse";
     $id = 1;
     $test_brand = new Brand($brand_name, $id);
     $new_name = "Nike";
     //Act
     $test_brand->setBrandName($new_name);
     $result = $test_brand->getBrandName();
     //Assert
     $this->assertEquals($new_name, $result);
 }