Returns the Contao version and build number.
public getContaoVersion ( ) : string | ||
리턴 | string |
/** * Tests the collect() method in the back end scope. */ public function testCollectInBackendScope() { $GLOBALS['TL_DEBUG'] = ['classes_set' => ['Contao\\System'], 'classes_aliased' => ['ContentText' => 'Contao\\ContentText'], 'classes_composerized' => ['ContentImage' => 'Contao\\ContentImage'], 'additional_data' => 'data']; $collector = new ContaoDataCollector(['contao/core-bundle' => '4.0.0']); $collector->setContainer($this->mockContainerWithContaoScopes(ContaoCoreBundle::SCOPE_BACKEND)); $collector->collect(new Request(), new Response()); $this->assertEquals(['ContentText' => 'Contao\\ContentText'], $collector->getClassesAliased()); $this->assertEquals(['ContentImage' => 'Contao\\ContentImage'], $collector->getClassesComposerized()); $this->assertEquals(['version' => '4.0.0', 'framework' => true, 'models' => 5, 'frontend' => false, 'preview' => false, 'layout' => '', 'template' => ''], $collector->getSummary()); $this->assertEquals('4.0.0', $collector->getContaoVersion()); $this->assertEquals(['Contao\\System'], $collector->getClassesSet()); $this->assertEquals(['additional_data' => 'data'], $collector->getAdditionalData()); $this->assertEquals('contao', $collector->getName()); unset($GLOBALS['TL_DEBUG']); }
/** * Tests the collect() method in the back end scope. */ public function testCollectInBackendScope() { $container = $this->mockContainerWithContaoScopes(); $container->enterScope(ContaoCoreBundle::SCOPE_BACKEND); $collector = new ContaoDataCollector($container, ['contao/core-bundle' => '4.0.0']); $GLOBALS['TL_DEBUG'] = ['classes_aliased' => ['ContentText <span>Contao\\ContentText</span>'], 'classes_set' => ['Contao\\System'], 'unknown_insert_tags' => ['foo'], 'unknown_insert_tag_flags' => ['bar'], 'additional_data' => 'data']; $collector->collect(new Request(), new Response()); $this->assertEquals(['ContentText' => ['alias' => 'ContentText', 'original' => 'Contao\\ContentText']], $collector->getClassesAliased()); $this->assertEquals(['version' => '4.0.0', 'scope' => ContaoCoreBundle::SCOPE_BACKEND, 'layout' => '', 'framework' => true, 'models' => 5], $collector->getSummary()); $this->assertEquals('4.0.0', $collector->getContaoVersion()); $this->assertEquals(['Contao\\System'], $collector->getClassesSet()); $this->assertEquals(['foo'], $collector->getUnknownInsertTags()); $this->assertEquals(['bar'], $collector->getUnknownInsertTagFlags()); $this->assertEquals(['additional_data' => 'data'], $collector->getAdditionalData()); $this->assertEquals('contao', $collector->getName()); unset($GLOBALS['TL_DEBUG']); }