Exemple #1
0
 public function testAddDefaultEmbedsToChildScope()
 {
     $this->scope = new Scope($this->composerManager, $this->resource, 'bar');
     $this->scope->setParentScopes(array('', 'foo'));
     $this->scope->addDefaultEmbeds(array('baz'));
     $this->assertContains('foo.bar.baz', $this->composerManager->getRequestedScopes());
 }
 /**
  * Test that we can add scopes to a composerManager already populated
  *
  * @param array $initialScopes          The array of initial scopes added to the composerManager
  * @param array $additionalScopes       The array of additional scopes we want to add
  * @param array $requestedScopesOutput  The array we expect the composerManager contains
  *
  * @dataProvider additionalRequestedScopesProvider
  */
 public function testAdditionalRequestedScopesAreWellMerged($initialScopes, $additionalScopes, $requestedScopesOutput)
 {
     $this->composerManager->setRequestedScopes($initialScopes);
     $this->composerManager->addRequestedScopes($additionalScopes);
     $this->assertEquals(count($requestedScopesOutput), count($this->composerManager->getRequestedScopes()));
     foreach ($requestedScopesOutput as $scope) {
         $this->assertContains($scope, $this->composerManager->getRequestedScopes());
     }
 }