function testEditEntity() { self::$uuid = Data::createChannel('Power', 'power', 1); // expect title updated $val = 'NewTitle'; $this->assertEquals($val, $this->getJson('/entity/' . self::$uuid . '.json', array('operation' => 'edit', 'title' => $val))->entity->title); }
function testEditEntityInvalidProperties() { self::$uuid = Data::createChannel('Power', 'power', 1); $uri = '/entity/' . self::$uuid . '.json'; // expect float type exception $this->getJson($uri, array('operation' => 'edit', 'resolution' => '42.fourtytwo'), 'GET', true); $this->assertStringStartsWith('Invalid property value', $this->json->exception->message); // expect boolean type exception $this->getJson($uri, array('operation' => 'edit', 'active' => 'wahr'), 'GET', true); $this->assertStringStartsWith('Invalid property value', $this->json->exception->message); // expect boolean type exception - property currently not supported // $this->getJson($uri, array( // 'operation' => 'edit', // 'active' => true // ), 'GET', true); // $this->assertStringStartsWith('Invalid property value', $this->json->exception->message); }