/** * ArrayMap に値を put した際に ArrayMapEntry オブジェクトが生成されることを確認します. * @covers Peach\Util\ArrayMapEntry::__construct */ public function test__construct() { $map = new ArrayMap(); $map->put("key", "value"); $entryList = $map->entryList(); $this->assertInstanceOf("Peach\\Util\\ArrayMapEntry", $entryList[0]); }
/** * containesKey() のテストです. * 以下を確認します. * * - 存在しないキー名を指定した場合は false を返す * - 存在するキー名を指定した場合は true を返す * - 値に null をセットしたエントリについても true を返す * * @covers Peach\Util\ArrayMap::containsKey */ public function testContainsKey() { $this->object->put("test1", null); $this->assertFalse($this->object->containsKey("key4")); $this->assertTrue($this->object->containsKey("key2")); $this->assertTrue($this->object->containsKey("test1")); }
public function parseExecuteCode($json) { $decoded = json_decode($json, true); if ($this->isSuccess($decoded)) { $files = new ArrayMap(); if (isset($decoded['deployr']['response']['files'])) { foreach ($decoded['deployr']['response']['files'] as $name => $file) { $files->put($name, $file['value']); } } return new DeployRExecution($decoded['deployr']['response']['robjects'], $files); } else { throw new DeployRResponseException('session - execute code - success attribute is not true'); } }
/** * このエントリーの値を更新します. * @param mixed $value 新しくセットされる値 */ public function setValue($value) { $this->map->put($this->key, $value); $this->value = $value; }