/** * @expectedException Exception */ function testShouldDisallowChangingID() { $product = new Product(); $product->setId(1); $product->setId(2); }