Esempio n. 1
0
 function testGetBrandName()
 {
     $brand_name = "Air Jordan";
     $test_brand = new Brand($brand_name);
     $result = $test_brand->getBrandName();
     $this->assertEquals($brand_name, $result);
 }
Esempio n. 2
0
 function test_getBrandName()
 {
     //Arrange
     $brand_name = "Nike";
     $test_brand = new Brand($brand_name);
     //Act
     $result = $test_brand->getBrandName();
     //Assert
     $this->assertEquals("Nike", $result);
 }
Esempio n. 3
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);
 }
Esempio n. 4
0
 function test_setBrandName()
 {
     //Arrange
     $brand_name = "BRAH-DIDAS";
     $test_brand = new Brand($brand_name);
     //Act
     $test_brand->setBrandName($brand_name);
     $result = $test_brand->getBrandName();
     //Assert
     $this->assertEquals("BRAH-DIDAS", $result);
 }
Esempio n. 5
0
 function test_setBrandName()
 {
     //Arrange
     $brand_name = "Converse";
     $id = null;
     $test_brand = new Brand($brand_name, $id);
     //Act
     $test_brand->setBrandName("Nike");
     $result = $test_brand->getBrandName();
     //Assert
     $this->assertEquals("Nike", $result);
 }
 public function delete($id)
 {
     $brand = Brand::getBrandName($id);
     $rowdelete = Drugcode::deleteBrand($id);
     //If query succeeds
     if ($rowdelete > 0) {
         //$this -> session -> set_userdata('message_counter', '1');
         $this->session->set_userdata('msg_error', $brand['Brand'] . ' was deleted !');
     } else {
         //$this -> session -> set_userdata('message_counter', '2');
         $this->session->set_userdata('msg_error', 'An error occured while deleting the brand. Try again !');
     }
     redirect("settings_management");
 }
Esempio n. 7
0
 function testUpdate()
 {
     //Arrange
     $brand_name = "Sketchers";
     $test_brand = new Brand($brand_name);
     $test_brand->save();
     $new_name = "Vans";
     //Act
     $test_brand->update($new_name);
     //Assert
     $this->assertEquals($new_name, $test_brand->getBrandName());
 }
Esempio n. 8
0
 function testUpdate()
 {
     //Arrange
     $brand_name = "Nike";
     $id = 1;
     $test_brand = new Brand($brand_name, $id);
     $test_brand->save();
     $new_brand_name = "Fila";
     //Act
     $test_brand->update($new_brand_name);
     //Assert
     $this->assertEquals('Fila', $test_brand->getBrandName());
 }