Example #1
0
 /**
  * @test
  */
 public function updateShouldUpdateOnlyChangedFieldsWhenObjectWasCreatedByHandAndIdWasSet()
 {
     //given
     $product = Product::create(array('name' => 'Sport', 'price' => '123'));
     $id = $product->getId();
     $product = new Product(array('name' => 'Water', 'price' => '123', 'id' => $id));
     // when
     $product->update();
     // then
     $actual = Product::findById($product->getId());
     $this->assertEquals('Water', $actual->name);
 }