Certificationy\Certification\Loader::getCategories PHP Method

getCategories() public static method

Get list of all categories
public static getCategories ( $path ) : array
return array
    public static function getCategories($path)
    {
        $categories = array();
        $files = self::prepareFromYaml(array(), $path);
        foreach ($files as $file) {
            $categories[] = $file['category'];
        }
        return array_unique($categories);
    }

Usage Example

 public function testCanListCategories()
 {
     $commandTester = new CommandTester($this->command);
     $commandTester->execute(array('command' => $this->command->getName(), '-l' => true));
     $output = $commandTester->getDisplay();
     $this->assertRegExp('/Templating/', $output);
     $this->assertCount(count(Loader::getCategories($this->configFile)) + 1, explode("\n", $output));
 }
All Usage Examples Of Certificationy\Certification\Loader::getCategories