Skip to content
This repository has been archived by the owner on Apr 11, 2018. It is now read-only.

Commit

Permalink
APOLLO-3734 Serializer now returns true/false/null on isAttorneyApply…
Browse files Browse the repository at this point in the history
…ingToRegister
  • Loading branch information
brettminnie committed Aug 7, 2014
1 parent 36d689e commit 1ef0c2b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
27 changes: 22 additions & 5 deletions src/Opg/Core/Model/Entity/CaseItem/Lpa/Party/Attorney.php
Expand Up @@ -48,6 +48,8 @@ class Attorney extends AttorneyAbstract implements PartyInterface, HasRelationsh
/**
* @ORM\Column(type = "integer", nullable = true)
* @var int
* @Type("boolean")
* @Accessor(getter="getIsAttorneyApplyingToRegister", setter="setIsAttorneyApplyingToRegister")
*/
protected $isAttorneyApplyingToRegister = self::OPTION_NOT_SET;

Expand Down Expand Up @@ -208,22 +210,37 @@ public function getLpaPartCSignatureDateString()
}

/**
* @param int $isAttorneyApplyingToRegister
* @param bool $isAttorneyApplyingToRegister
*
* @return Attorney
*/
public function setIsAttorneyApplyingToRegister($isAttorneyApplyingToRegister = self::OPTION_FALSE)
public function setIsAttorneyApplyingToRegister($isAttorneyApplyingToRegister = null)
{
$this->isAttorneyApplyingToRegister = $isAttorneyApplyingToRegister;
switch ($isAttorneyApplyingToRegister) {
case true:
$this->isAttorneyApplyingToRegister = self::OPTION_TRUE;
break;
case false:
$this->isAttorneyApplyingToRegister = self::OPTION_FALSE;
break;
default:
$this->isAttorneyApplyingToRegister = self::OPTION_NOT_SET;
}

return $this;
}

/**
* @return int
* @return bool
*/
public function getIsAttorneyApplyingToRegister()
{
return $this->isAttorneyApplyingToRegister;
switch ($this->isAttorneyApplyingToRegister) {
case self::OPTION_TRUE:
return (bool)true;
break;
default:
return (bool)false;
}
}
}
Expand Up @@ -137,9 +137,16 @@ public function testGetSetIsAttorneyApplyingToRegister()
{
$this->assertEquals(Attorney::OPTION_NOT_SET, $this->attorney->getIsAttorneyApplyingToRegister());

$this->attorney->setIsAttorneyApplyingToRegister(Attorney::OPTION_FALSE);
$this->assertEquals(Attorney::OPTION_FALSE, $this->attorney->getIsAttorneyApplyingToRegister());
$this->assertNotEquals(Attorney::OPTION_TRUE, $this->attorney->getIsAttorneyApplyingToRegister());
$this->attorney->setIsAttorneyApplyingToRegister(false);
$this->assertFalse($this->attorney->getIsAttorneyApplyingToRegister());
$this->assertNotEquals(true, $this->attorney->getIsAttorneyApplyingToRegister());
}

public function testUnsetIsAttorneyApplyingToRegister()
{
$this->assertEquals(Attorney::OPTION_NOT_SET, $this->attorney->getIsAttorneyApplyingToRegister());
$this->attorney->setIsAttorneyApplyingToRegister();
$this->assertNotNull($this->attorney->getIsAttorneyApplyingToRegister());
}

public function testGetInputFilter()
Expand Down

0 comments on commit 1ef0c2b

Please sign in to comment.