Example #1
0
 public function testGetAndSetCustomerGroupId()
 {
     $groupId = 5;
     $propertyGroupId = 6;
     $setValue = 8;
     $this->customerSession->expects($this->once())->method('getCustomerGroupId')->will($this->returnValue($groupId));
     $property = new \ReflectionProperty($this->item, 'customerGroupId');
     $property->setAccessible(true);
     $this->assertNull($property->getValue($this->item));
     $this->assertSame($groupId, $this->item->getCustomerGroupId());
     $this->assertNull($property->getValue($this->item));
     $property->setValue($this->item, $propertyGroupId);
     $this->assertSame($propertyGroupId, $property->getValue($this->item));
     $this->assertSame($propertyGroupId, $this->item->getCustomerGroupId());
     $this->assertSame($this->item, $this->item->setCustomerGroupId($setValue));
     $this->assertSame($setValue, $property->getValue($this->item));
     $this->assertSame($setValue, $this->item->getCustomerGroupId());
 }