You are here

public function InstantArticleContentEntityNormalizerTest::sortComponentsProvider in Facebook Instant Articles 8.2

Same name and namespace in other branches
  1. 3.x tests/src/Unit/InstantArticleContentEntityNormalizerTest.php \Drupal\Tests\fb_instant_articles\Unit\InstantArticleContentEntityNormalizerTest::sortComponentsProvider()

Data provider for testSortComponents.

Return value

array Return an array or arrays of arguments to testSortComponents.

File

tests/src/Unit/InstantArticleContentEntityNormalizerTest.php, line 117

Class

InstantArticleContentEntityNormalizerTest
Tests the fbia content entity normalizer class.

Namespace

Drupal\Tests\fb_instant_articles\Unit

Code

public function sortComponentsProvider() {
  return [
    [
      [
        [
          'region' => 'header',
          'weight' => 0,
        ],
        [
          'region' => 'content',
          'weight' => 1,
        ],
        [
          'region' => 'footer',
          'weigth' => 2,
        ],
      ],
      [
        [
          'region' => 'header',
          'weight' => 0,
        ],
        [
          'region' => 'content',
          'weight' => 1,
        ],
        [
          'region' => 'footer',
          'weigth' => 2,
        ],
      ],
    ],
    [
      [
        [
          'region' => 'header',
          'weight' => 0,
        ],
        [
          'region' => 'footer',
          'weight' => 2,
        ],
        [
          'region' => 'content',
          'weight' => 1,
        ],
      ],
      [
        [
          'region' => 'header',
          'weight' => 0,
        ],
        [
          'region' => 'content',
          'weight' => 1,
        ],
        [
          'region' => 'footer',
          'weight' => 2,
        ],
      ],
    ],
    [
      [
        [
          'region' => 'footer',
          'weight' => 2,
        ],
        [
          'region' => 'header',
          'weight' => 0,
        ],
        [
          'region' => 'content',
          'weight' => 1,
        ],
      ],
      [
        [
          'region' => 'header',
          'weight' => 0,
        ],
        [
          'region' => 'content',
          'weight' => 1,
        ],
        [
          'region' => 'footer',
          'weight' => 2,
        ],
      ],
    ],
    [
      [
        [
          'region' => 'header',
          'weight' => 100,
        ],
        [
          'region' => 'content',
          'weight' => -100,
        ],
        [
          'region' => 'footer',
          'weight' => 0,
        ],
      ],
      [
        [
          'region' => 'header',
          'weight' => 100,
        ],
        [
          'region' => 'content',
          'weight' => -100,
        ],
        [
          'region' => 'footer',
          'weight' => 0,
        ],
      ],
    ],
    [
      [
        [
          'region' => 'footer',
        ],
        [
          'region' => 'content',
        ],
        [
          'region' => 'header',
        ],
      ],
      [
        [
          'region' => 'header',
        ],
        [
          'region' => 'content',
        ],
        [
          'region' => 'footer',
        ],
      ],
    ],
  ];
}