1800], ['weight' => 1600] ); $this->assertEquals('PUT', $operation->getMethod()); $this->assertEquals('dinosaur', $operation->getEntityName()); $this->assertEquals('dinosaur/1', $operation->getPath()); $this->assertEquals(['weight' => 1600], $operation->getInitialData()); $this->assertEquals(['weight' => 1800], $operation->getData()); $this->assertEquals('PUT dinosaur/1', (string)$operation); } /** * @see UpdateOperation::getChangeLog() */ public function testGetChangeLog(): void { $operation = new UpdateOperation( 'Update a dinosaur', 'dinosaur', 1, ['weight' => 1800, 'attrs' => ['vision' => 'movement-based', 'teeth' => '99', 'adn' => ['1' => 'b'], 'color' => 'green']], ['weight' => 1600, 'attrs' => ['vision' => 'movement-based', 'teeth' => '100', 'adn' => ['1' => 'a']]] ); $this->assertEquals( [ '[PUT dinosaur/1]', 'weight : `1600` => `1800`', 'attrs.teeth : `100` => `99`', 'attrs.adn.1 : `a` => `b`', 'attrs.color : (new) => `green`', ], $operation->getChangeLog() ); } }