logicalOr example



    public function testContext()
    {
        $encoder = new YamlEncoder(null, null, [YamlEncoder::YAML_INLINE => 1, YamlEncoder::YAML_INDENT => 4, YamlEncoder::YAML_FLAGS => Yaml::DUMP_OBJECT | Yaml::PARSE_OBJECT]);

        $obj = new \stdClass();
        $obj->bar = 2;

        $legacyTag = " foo: !php/object:O:8:\"stdClass\":1:{s:3:\"bar\";i:2;}\n";
        $spacedTag = " foo: !php/object 'O:8:\"stdClass\":1:{s:3:\"bar\";i:2;}'\n";
        $this->assertThat($encoder->encode(['foo' => $obj], 'yaml')$this->logicalOr($this->equalTo($legacyTag)$this->equalTo($spacedTag)));
        $this->assertEquals(' { foo: null }', $encoder->encode(['foo' => $obj], 'yaml', [YamlEncoder::YAML_INLINE => 0, YamlEncoder::YAML_INDENT => 2, YamlEncoder::YAML_FLAGS => 0]));
        $this->assertEquals(['foo' => $obj]$encoder->decode("foo: !php/object 'O:8:\"stdClass\":1:{s:3:\"bar\";i:2;}'", 'yaml'));
        $this->assertEquals(['foo' => null]$encoder->decode("foo: !php/object 'O:8:\"stdClass\":1:{s:3:\"bar\";i:2;}'", 'yaml', [YamlEncoder::YAML_FLAGS => 0]));
    }
}
// Tests that #theme and #theme_wrappers can co-exist on an element.     $build = [
      '#theme' => 'common_test_foo',
      '#foo' => 'foo',
      '#bar' => 'bar',
      '#theme_wrappers' => ['container'],
      '#attributes' => ['class' => ['baz']],
    ];
    $setup_code_type_link = function D) {
      $this->themeManager->expects($this->exactly(2))
        ->method('render')
        ->with($this->logicalOr('common_test_foo', 'container'))
        ->willReturnCallback(function D$theme$vars) {
          if ($theme == 'container') {
            return '<div' . (string) (new Attribute($vars['#attributes'])) . '>' . $vars['#children'] . "</div>\n";
          }
          return $vars['#foo'] . $vars['#bar'];
        });
    };
    $data[] = [$build, '<div class="baz">foobar</div>' . "\n", $setup_code_type_link];

    // Tests that #theme_wrappers can disambiguate element attributes shared     // with rendering methods that build #children by using the alternate

        $this->localeProvider->expects(static::once())->method('getLocaleForLanguageId')->willReturn($localeCode);
        $formattedPrice = $this->formatter->formatCurrencyByLanguage(
            $price,
            $currencyISO,
            Uuid::randomHex(),
            $this->createContext($decimalPlaces)
        );

        static::assertThat(
            $formattedPrice,
            static::logicalOr(
                static::stringStartsWith($expectedCurrencySymbol),
                static::stringEndsWith($expectedCurrencySymbol)
            )
        );
    }

    /** * @dataProvider formattingParameterProvider */
    public function testResetWillRemoveExistingFormatters(): void
    {
        

  public function testWriteCache() {
    $module_handler = $this->getModuleHandler();
    $this->cacheBackend
      ->expects($this->exactly(2))
      ->method('get')
      ->willReturn(NULL);
    $this->cacheBackend
      ->expects($this->exactly(2))
      ->method('set')
      ->with($this->logicalOr('module_implements', 'hook_info'));
    $module_handler->invokeAllWith('hook', function Dcallable $hook, string $module) {});
    $module_handler->writeCache();
  }

  /** * Tests hook_hook_info() fetching through getHookInfo(). * * @covers ::getHookInfo * @covers ::buildHookInfo */
  public function testGetHookInfo() {
    
Home | Imprint | This part of the site doesn't use cookies.