function SelectLeastTest::testSelectLeast

Same name in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Database/SelectLeastTest.php \Drupal\KernelTests\Core\Database\SelectLeastTest::testSelectLeast()
  2. 11.x core/tests/Drupal/KernelTests/Core/Database/SelectLeastTest.php \Drupal\KernelTests\Core\Database\SelectLeastTest::testSelectLeast()

Tests the SQL LEAST operator.

@dataProvider selectLeastProvider

File

core/tests/Drupal/KernelTests/Core/Database/SelectLeastTest.php, line 17

Class

SelectLeastTest
Tests the SQL LEAST operator.

Namespace

Drupal\KernelTests\Core\Database

Code

public function testSelectLeast($values, $expected) {
    $least = $this->connection
        ->query("SELECT LEAST(:values[])", [
        ':values[]' => $values,
    ])
        ->fetchField();
    $this->assertEquals($expected, $least);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.