/** * Get used scopes in current inspection * * @return array */ public function getScopeListAttribute() { $scopes = (int) $this->attributes['scopes']; foreach (SubScope::all() as $subScope) { if (($scopes & $subScope->code) > 0) { $scopeList[] = $subScope->scope->category; } } return collect(array_unique($scopeList)); }
/** * Test Relationship SubScope with Scope * * @return void */ public function testRelationshipWithScope() { $subScope = new SubScope(); $this->assertInstanceOf(BelongsTo::class, $subScope->scope()); }