You are here

public function ElementTest::testOxford in Lightning Core 8.4

Same name in this branch
  1. 8.4 tests/src/Unit/ElementTest.php \Drupal\Tests\lightning_core\Unit\ElementTest::testOxford()
  2. 8.4 tests/src/Kernel/ElementTest.php \Drupal\Tests\lightning_core\Kernel\ElementTest::testOxford()
Same name and namespace in other branches
  1. 8.5 tests/src/Kernel/ElementTest.php \Drupal\Tests\lightning_core\Kernel\ElementTest::testOxford()
  2. 8 tests/src/Kernel/ElementTest.php \Drupal\Tests\lightning_core\Kernel\ElementTest::testOxford()
  3. 8.2 tests/src/Kernel/ElementTest.php \Drupal\Tests\lightning_core\Kernel\ElementTest::testOxford()
  4. 8.3 tests/src/Kernel/ElementTest.php \Drupal\Tests\lightning_core\Kernel\ElementTest::testOxford()

@covers ::oxford

File

tests/src/Kernel/ElementTest.php, line 18

Class

ElementTest
@coversDefaultClass \Drupal\lightning_core\Element

Namespace

Drupal\Tests\lightning_core\Kernel

Code

public function testOxford() {
  $this
    ->assertEmpty(Element::oxford([]));
  $this
    ->assertEquals('fettucine', Element::oxford([
    'fettucine',
  ]));
  $this
    ->assertEquals('fettucine and linguine', Element::oxford([
    'fettucine',
    'linguine',
  ]));
  $this
    ->assertEquals('fettucine, linguine, and ravioli', Element::oxford([
    'fettucine',
    'linguine',
    'ravioli',
  ]));
}