示例#1
0
 /**
  * Test get returns null if key doesn't exist
  */
 public function testGetReturnsNullWhenKeyNotExists()
 {
     $entity = new Entity([]);
     $this->assertNull($entity->get("doesntExist"));
 }
示例#2
0
 /**
  * Populate an entity from request or response body
  *
  * @param string $body
  * @param Entity $entity
  * @return Entity
  */
 public function entityFromBody($body, $entity)
 {
     $json = $this->decodeJson($body);
     return $entity->populate($json);
 }