Esempio n. 1
0
 /**
  *
  */
 public function testParseData()
 {
     $filename = $this->createInfoFile();
     $this->string($filename)->contains('ato');
     $info = new \Cerbere\Parser\Info($filename);
     $info->processFile($filename);
     $this->class($info);
     $project = $info->getProject();
     $this->string(get_class($project))->isEqualTo('Cerbere\\Model\\Project');
     $this->string($project->getCore())->isEqualTo('7.x');
     $this->string($project->getVersion())->isEqualTo('7.x-3.11');
     $this->string($project->getName())->isEqualTo('Views');
     $this->string($project->getDatestamp())->isEqualTo('1430321048');
     $details = $project->getDetails();
     $this->string($details['styles'][0][0])->isEqualTo(PHP_VERSION);
 }
Esempio n. 2
0
 public function testSupportedFile()
 {
     $info = new \Cerbere\Parser\Info();
     $this->boolean($info->supportedFile('foo.bar'))->isFalse();
     $this->boolean($info->supportedFile('foo.yml'))->isFalse();
     $this->boolean($info->supportedFile('foo.yaml'))->isFalse();
     $this->boolean($info->supportedFile('foo.maker'))->isFalse();
     $this->boolean($info->supportedFile('info/foo.yml'))->isFalse();
     $this->boolean($info->supportedFile('make/foo.yml'))->isFalse();
     $this->boolean($info->supportedFile('foo.info'))->isTrue();
     $this->boolean($info->supportedFile('foo.Info'))->isTrue();
     $this->boolean($info->supportedFile('foo.INFO'))->isTrue();
     $this->boolean($info->supportedFile('test/foo.INFO'))->isTrue();
 }
Esempio n. 3
0
    protected function createProjectFromFile()
    {
        $data = 'name = Views
description = Create customized lists and queries from your database.
package = Views
core = 9.x
php = 5.2

; Information added by Drupal.org packaging script on 2015-04-29
version = "7.x-8.11"
core = "8.x"
project = "views"
datestamp = "1430321048"
';
        $filename = $this->createFile($data);
        $info = new \Cerbere\Parser\Info();
        $info->processFile($filename);
        $project = $info->getProject();
        return $project;
    }
Esempio n. 4
0
    protected function createProjectSearchAPIFromFile()
    {
        $data = 'name = Search API
description = "Provides a generic API for modules offering search capabilites."
dependencies[] = entity
core = 7.x
package = Search

files[] = search_api.test
files[] = includes/callback.inc
files[] = includes/callback_add_aggregation.inc
files[] = includes/callback_add_hierarchy.inc
files[] = includes/callback_add_url.inc
files[] = includes/callback_add_viewed_entity.inc
files[] = includes/callback_bundle_filter.inc
files[] = includes/callback_comment_access.inc
files[] = includes/callback_language_control.inc
files[] = includes/callback_node_access.inc
files[] = includes/callback_node_status.inc
files[] = includes/callback_role_filter.inc
files[] = includes/callback_user_status.inc
files[] = includes/datasource.inc
files[] = includes/datasource_entity.inc
files[] = includes/datasource_external.inc
files[] = includes/datasource_multiple.inc
files[] = includes/exception.inc
files[] = includes/index_entity.inc
files[] = includes/processor.inc
files[] = includes/processor_highlight.inc
files[] = includes/processor_html_filter.inc
files[] = includes/processor_ignore_case.inc
files[] = includes/processor_stopwords.inc
files[] = includes/processor_tokenizer.inc
files[] = includes/processor_transliteration.inc
files[] = includes/query.inc
files[] = includes/server_entity.inc
files[] = includes/service.inc

configure = admin/config/search/search_api

; Information added by Drupal.org packaging script on 2016-02-26
version = "7.x-1.16+29-dev"
core = "7.x"
project = "search_api"
datestamp = "1456500713"
';
        $filename = $this->createFile($data);
        $info = new \Cerbere\Parser\Info();
        $info->processFile($filename);
        $project = $info->getProject();
        return $project;
    }