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]); }
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); }
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); }
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(); } }
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); }