当前位置: 首页>>代码示例>>PHP>>正文


PHP ThemeInterface::getName方法代码示例

本文整理汇总了PHP中Sylius\Bundle\ThemeBundle\Model\ThemeInterface::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP ThemeInterface::getName方法的具体用法?PHP ThemeInterface::getName怎么用?PHP ThemeInterface::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sylius\Bundle\ThemeBundle\Model\ThemeInterface的用法示例。


在下文中一共展示了ThemeInterface::getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 function it_throws_an_exception_if_resource_can_not_be_located(Filesystem $filesystem, ThemeInterface $theme)
 {
     $theme->getName()->willReturn('theme/name');
     $theme->getPath()->willReturn('/theme/path');
     $filesystem->exists('/theme/path/resource')->willReturn(false);
     $this->shouldThrow(ResourceNotFoundException::class)->during('locateResource', ['resource', $theme]);
 }
开发者ID:Sylius,项目名称:SyliusThemeBundle,代码行数:7,代码来源:ApplicationResourceLocatorSpec.php

示例2:

 function it_throws_an_exception_if_settings_schema_does_not_exist(ThemeInterface $theme)
 {
     $theme->getTitle()->willReturn('Candy shop');
     $theme->getName()->willReturn('candy/shop');
     $theme->getPath()->willReturn($this->vfsStream->url());
     $this->shouldThrow(new \InvalidArgumentException(sprintf('Could not find settings schema of theme "Candy shop" (candy/shop) in file "%s"', $this->vfsStream->url() . '/Settings.php')))->during('getSchema', [$theme]);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:7,代码来源:ThemeSettingsSchemaProviderSpec.php

示例3: channelUsesTheme

 /**
  * @Given channel :channel uses :theme theme
  */
 public function channelUsesTheme(ChannelInterface $channel, ThemeInterface $theme)
 {
     $channel->setThemeName($theme->getName());
     $this->channelManager->persist($channel);
     $this->channelManager->flush();
     $this->sharedStorage->set('channel', $channel);
     $this->sharedStorage->set('theme', $theme);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:11,代码来源:ThemeContext.php

示例4: it_should_return_global_variables

 public function it_should_return_global_variables(ThemeInterface $theme, ThemeContextInterface $themeContext)
 {
     $theme->getName()->willReturn('swp/theme-one');
     $theme->getPath()->willReturn('/path/to/theme/');
     $themeContext->getTheme()->shouldBeCalled()->willReturn($theme);
     $globals = ['theme' => $theme];
     $this->getGlobals()->shouldReturn($globals);
 }
开发者ID:superdesk,项目名称:web-publisher,代码行数:8,代码来源:CoreExtensionSpec.php

示例5: updateTheme

 /**
  * @param ThemeInterface $theme
  */
 private function updateTheme(ThemeInterface $theme)
 {
     $existingTheme = $this->themeRepository->findOneByName($theme->getName());
     if (null !== $existingTheme) {
         $theme = $this->themeMerger->merge($existingTheme, $theme);
     }
     $this->themeRepository->add($theme);
 }
开发者ID:ahmadrabie,项目名称:Sylius,代码行数:11,代码来源:ThemeSynchronizer.php

示例6: it_defines_themes_names_choices

 public function it_defines_themes_names_choices(OptionsResolver $resolver, ThemeProviderInterface $themeProvider, ThemeInterface $theme)
 {
     $theme->getName()->willReturn('swp/theme-name');
     $themeProvider->getCurrentTenantAvailableThemes()->willReturn([$theme]);
     $resolver->setNormalizer('choices', Argument::type('callable'))->willReturn($resolver);
     $resolver->setDefaults(['invalid_message' => 'The selected theme does not exist'])->shouldBeCalled();
     $this->configureOptions($resolver);
 }
开发者ID:superdesk,项目名称:web-publisher,代码行数:8,代码来源:ThemeNameChoiceTypeSpec.php

示例7:

 function it_registers_theme_schema_alias_if_not_exists_during_loading_settings(SettingsManagerInterface $decoratedSettingsManager, ServiceRegistryInterface $schemaRegistry, ThemeSettingsSchemaProviderInterface $themeSettingsSchemaProvider, ThemeInterface $theme, SettingsInterface $settings, SchemaInterface $schema)
 {
     $theme->getName()->willReturn('theme/name');
     $schemaRegistry->has('theme_theme/name')->willReturn(false);
     $themeSettingsSchemaProvider->getSchema($theme)->willReturn($schema);
     $schemaRegistry->register('theme_theme/name', $schema)->shouldBeCalled();
     $decoratedSettingsManager->load('theme_theme/name', null)->willReturn($settings);
     $this->load($theme)->shouldReturn($settings);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:9,代码来源:ThemeSettingsManagerSpec.php

示例8:

 function it_transforms_a_cycle_to_user_friendly_message(ThemeInterface $firstTheme, ThemeInterface $secondTheme, ThemeInterface $thirdTheme, ThemeInterface $fourthTheme)
 {
     $this->beConstructedWith([$firstTheme, $secondTheme, $thirdTheme, $fourthTheme, $thirdTheme]);
     $firstTheme->getName()->willReturn('first/theme');
     $secondTheme->getName()->willReturn('second/theme');
     $thirdTheme->getName()->willReturn('third/theme');
     $fourthTheme->getName()->willReturn('fourth/theme');
     $this->getMessage()->shouldReturn('Circular dependency was found while resolving theme "first/theme", caused by cycle "third/theme -> fourth/theme -> third/theme".');
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:9,代码来源:CircularDependencyFoundExceptionSpec.php

示例9: load

 /**
  * {@inheritdoc}
  */
 public function load(ThemeInterface $theme, $namespace = null)
 {
     $schemaAlias = sprintf('theme_%s', $theme->getName());
     if (!$this->schemaRegistry->has($schemaAlias)) {
         $schema = $this->themeSettingsSchemaProvider->getSchema($theme);
         $this->schemaRegistry->register($schemaAlias, $schema);
     }
     return $this->decoratedSettingsManager->load($schemaAlias, $namespace);
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:12,代码来源:ThemeSettingsManager.php

示例10:

 function it_throws_resource_not_found_exception_if_the_location_found_in_cache_is_null(TemplateLocatorInterface $decoratedTemplateLocator, Cache $cache, TemplateReferenceInterface $template, ThemeInterface $theme)
 {
     $template->getLogicalName()->willReturn('Logical:Name');
     $template->getPath()->willReturn('@Acme/template.html.twig');
     $theme->getName()->willReturn('theme/name');
     $cache->contains('Logical:Name|theme/name')->willReturn(true);
     $cache->fetch('Logical:Name|theme/name')->willReturn(null);
     $decoratedTemplateLocator->locateTemplate(Argument::cetera())->shouldNotBeCalled();
     $this->shouldThrow(ResourceNotFoundException::class)->during('locateTemplate', [$template, $theme]);
 }
开发者ID:TheMadeleine,项目名称:Sylius,代码行数:10,代码来源:CachedTemplateLocatorSpec.php

示例11:

 function it_returns_theme_list_in_hierarchized_order(ThemeRepositoryInterface $themeRepository, ThemeInterface $firstTheme, ThemeInterface $secondTheme)
 {
     $firstTheme->getName()->willReturn('foo/bar1');
     $firstTheme->getParentsNames()->willReturn(['foo/bar2']);
     $secondTheme->getName()->willReturn('foo/bar2');
     $secondTheme->getParentsNames()->willReturn([]);
     $themeRepository->findOneByName('foo/bar1')->willReturn($firstTheme);
     $themeRepository->findOneByName('foo/bar2')->willReturn($secondTheme);
     $this->getThemeHierarchy($firstTheme)->shouldReturn([$firstTheme, $secondTheme]);
 }
开发者ID:vikey89,项目名称:Sylius,代码行数:10,代码来源:ThemeHierarchyProviderSpec.php

示例12:

 function it_throws_an_exception_if_resource_can_not_be_located(Filesystem $filesystem, KernelInterface $kernel, ThemeInterface $theme, BundleInterface $childBundle, BundleInterface $parentBundle)
 {
     $kernel->getBundle('ParentBundle', false)->willReturn([$childBundle, $parentBundle]);
     $childBundle->getName()->willReturn('ChildBundle');
     $parentBundle->getName()->willReturn('ParentBundle');
     $theme->getName()->willReturn('theme/name');
     $theme->getPath()->willReturn('/theme/path');
     $filesystem->exists('/theme/path/ChildBundle/views/index.html.twig')->shouldBeCalled()->willReturn(false);
     $filesystem->exists('/theme/path/ParentBundle/views/index.html.twig')->shouldBeCalled()->willReturn(false);
     $this->shouldThrow(ResourceNotFoundException::class)->during('locateResource', ['@ParentBundle/Resources/views/index.html.twig', $theme]);
 }
开发者ID:TheMadeleine,项目名称:Sylius,代码行数:11,代码来源:BundleResourceLocatorSpec.php

示例13: __construct

 /**
  * @param ThemeInterface $theme
  * @param string $filepath
  */
 public function __construct(ThemeInterface $theme, $filepath)
 {
     $this->name = $filepath;
     $parts = explode('.', basename($filepath), 3);
     if (3 !== count($parts)) {
         throw new \InvalidArgumentException(sprintf('Could not create a translation resource with filepath "%s".', $filepath));
     }
     $this->domain = $parts[0];
     $this->locale = $parts[1] . '@' . str_replace('/', '-', $theme->getName());
     $this->format = $parts[2];
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:15,代码来源:ThemeTranslationResource.php

示例14: getSchema

 /**
  * {@inheritdoc}
  */
 public function getSchema(ThemeInterface $theme)
 {
     $schemaPath = sprintf('%s/Settings.php', $theme->getPath());
     if (!file_exists($schemaPath)) {
         throw new \InvalidArgumentException(sprintf('Could not find settings schema of theme "%s" (%s) in file "%s"', $theme->getTitle(), $theme->getName(), $schemaPath));
     }
     $schema = (require $schemaPath);
     if (!$schema instanceof SchemaInterface) {
         throw new \InvalidArgumentException(sprintf('File "%s" must return an instance of "%s"', $schemaPath, SchemaInterface::class));
     }
     return $schema;
 }
开发者ID:ReissClothing,项目名称:Sylius,代码行数:15,代码来源:ThemeSettingsSchemaProvider.php

示例15:

 function it_finds_circular_dependency_if_theme_parents_are_cycled(ThemeInterface $firstTheme, ThemeInterface $secondTheme, ThemeInterface $thirdTheme, ThemeInterface $fourthTheme)
 {
     $firstTheme->getParents()->willReturn([$secondTheme, $thirdTheme]);
     $secondTheme->getParents()->willReturn([$thirdTheme]);
     $thirdTheme->getParents()->willReturn([$fourthTheme]);
     $fourthTheme->getParents()->willReturn([$secondTheme]);
     $firstTheme->getName()->willReturn('first/theme');
     $secondTheme->getName()->willReturn('second/theme');
     $thirdTheme->getName()->willReturn('third/theme');
     $fourthTheme->getName()->willReturn('fourth/theme');
     $this->shouldThrow(CircularDependencyFoundException::class)->during('check', [$firstTheme]);
 }
开发者ID:TheMadeleine,项目名称:Sylius,代码行数:12,代码来源:CircularDependencyCheckerSpec.php


注:本文中的Sylius\Bundle\ThemeBundle\Model\ThemeInterface::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。