item = new Item(); } public function testGetCode() { $this->assertNotNull($this->item); $this->assertNull($this->item->getCode()); } /** * @depends testGetCode */ public function testSetCode() { $this->item->setCode('Code'); $this->assertNotNull($this->item->getCode()); $this->assertSame('Code', $this->item->getCode()); } public function testGetDescription() { $this->assertNotNull($this->item); $this->assertNull($this->item->getDescription()); } /** * @depends testGetDescription */ public function testSetDescription() { $this->item->setDescription('Description of Item'); $this->assertNotNull($this->item->getDescription()); $this->assertSame('Description of Item', $this->item->getDescription()); } public function testGetPrice() { $this->assertNotNull($this->item); $this->assertNull($this->item->getPrice()); } /** * @depends testGetPrice */ public function testSetPrice() { $this->item->setPrice(9.99); $this->assertNotNull($this->item->getPrice()); $this->assertSame(9.99, $this->item->getPrice()); $this->assertInternalType('float', $this->item->getPrice()); $this->item->setPrice("9.99"); $this->assertNotNull($this->item->getPrice()); $this->assertSame("9.99", $this->item->getPrice()); $this->assertInternalType('string', $this->item->getPrice()); } public function testGetQuantity() { $this->assertNotNull($this->item); $this->assertNull($this->item->getQuantity()); } /** * @depends testGetQuantity */ public function testSetQuantity() { $this->item->setQuantity(1); $this->assertNotNull($this->item->getQuantity()); $this->assertSame(1, $this->item->getQuantity()); } public function testIsPhysical() { $this->assertNotNull($this->item); $this->assertFalse($this->item->isPhysical()); } /** * @depends testIsPhysical */ public function testSetPhysicalTrue() { $this->item->setPhysical(true); $this->assertNotNull($this->item->isPhysical()); $this->assertTrue($this->item->isPhysical()); } }