/** * @covers ::initialize */ public function testInitialize() { $store = Store::getRepo(); $products = $store->getRelOrError('products'); $this->assertEquals('CL\\Purchases\\Product', $products->getRepo()->getModelClass()); $storePurchases = $store->getRelOrError('storePurchases'); $this->assertEquals('CL\\Purchases\\StorePurchase', $storePurchases->getRepo()->getModelClass()); $model = new Store(); $this->assertFalse($model->validate()); $errors = $model->getErrors()->humanize(); $expected = 'name must be present'; $this->assertEquals($expected, $errors); }