organization = new Organization(); $this->organization ->setParameters(new Parameters()) ->setSettings(new Settings()) ->setName('Foo') ; } /** * @see OrganizationProfileCreator::getOrganizationProfile() */ public function testGetOrganizationProfile(){ $moduleMock = $this->getMockBuilder(Module::class)->disableOriginalConstructor()->getMock(); $moduleMock ->method('getOrganizationModules') ->with($this->organization) ->willReturn(["MODULE_A", "MODULE_B"]); $treeMock = $this->getMockBuilder(Tree::class)->disableOriginalConstructor()->getMock(); $parent = new Organization(); $parent->setParameters(new Parameters()); $treeMock ->method('findAllParentsAndSortByType') ->with($this->organization) ->willReturn([$parent, $parent]); $organizationProfileCreator = new OrganizationProfileCreator($moduleMock,$treeMock); $organizationProfile = $organizationProfileCreator->getOrganizationProfile($this->organization); $this->assertInstanceOf(OrganizationProfile::class, $organizationProfile); } }