/** * @covers phpDocumentor\Descriptor\ProjectDescriptor::isVisibilityAllowed */ public function testIsVisibilityAllowed() { $this->assertTrue($this->fixture->isVisibilityAllowed(Settings::VISIBILITY_PUBLIC)); $this->assertTrue($this->fixture->isVisibilityAllowed(Settings::VISIBILITY_PROTECTED)); $this->assertTrue($this->fixture->isVisibilityAllowed(Settings::VISIBILITY_PRIVATE)); $this->assertFalse($this->fixture->isVisibilityAllowed(Settings::VISIBILITY_INTERNAL)); $settings = new Settings(); $settings->setVisibility(Settings::VISIBILITY_PROTECTED); $this->fixture->setSettings($settings); $this->assertFalse($this->fixture->isVisibilityAllowed(Settings::VISIBILITY_PUBLIC)); $this->assertTrue($this->fixture->isVisibilityAllowed(Settings::VISIBILITY_PROTECTED)); $this->assertFalse($this->fixture->isVisibilityAllowed(Settings::VISIBILITY_PRIVATE)); $this->assertFalse($this->fixture->isVisibilityAllowed(Settings::VISIBILITY_INTERNAL)); $settings->setVisibility(Settings::VISIBILITY_PROTECTED | Settings::VISIBILITY_INTERNAL); $this->fixture->setSettings($settings); $this->assertFalse($this->fixture->isVisibilityAllowed(Settings::VISIBILITY_PUBLIC)); $this->assertTrue($this->fixture->isVisibilityAllowed(Settings::VISIBILITY_PROTECTED)); $this->assertFalse($this->fixture->isVisibilityAllowed(Settings::VISIBILITY_PRIVATE)); $this->assertTrue($this->fixture->isVisibilityAllowed(Settings::VISIBILITY_INTERNAL)); }
/** * Finalizes the processing and executing all post-processing actions. * * This method is responsible for extracting and manipulating the data that * is global to the project, such as: * * - Package tree * - Namespace tree * - Marker list * - Deprecated elements listing * - Removal of objects related to visibility * * @return void */ protected function finalize(ProjectDescriptor $projectDescriptor) { // TODO: move all these behaviours to a central location for all template parsers $behaviour = new AuthorTag(); $behaviour->process($this->xml); $behaviour = new CoversTag(); $behaviour->process($this->xml); $behaviour = new IgnoreTag(); $behaviour->process($this->xml); $behaviour = new InternalTag($projectDescriptor->isVisibilityAllowed(ProjectDescriptor\Settings::VISIBILITY_INTERNAL)); $behaviour->process($this->xml); $behaviour = new LicenseTag(); $behaviour->process($this->xml); $behaviour = new MethodTag(); $behaviour->process($this->xml); $behaviour = new ParamTag(); $behaviour->process($this->xml); $behaviour = new PropertyTag(); $behaviour->process($this->xml); $behaviour = new ReturnTag(); $behaviour->process($this->xml); $behaviour = new UsesTag(); $behaviour->process($this->xml); $behaviour = new VarTag(); $behaviour->process($this->xml); $this->buildPackageTree($this->xml); $this->buildNamespaceTree($this->xml); $this->buildDeprecationList($this->xml); }