public function BasicTest::testNaturalSortDefaultWords in Views Natural Sort 8.2
File
- tests/
src/ Kernel/ BasicTest.php, line 73
Class
- BasicTest
- @group views_natural_sort
Namespace
Drupal\Tests\views_natural_sort\KernelCode
public function testNaturalSortDefaultWords() {
$node1 = Node::create([
'type' => 'views_natural_sort_test_content',
'title' => 'Red of Purple',
]);
$node1
->save();
$node2 = Node::create([
'type' => 'views_natural_sort_test_content',
'title' => 'Red or Green',
]);
$node2
->save();
$node3 = Node::create([
'type' => 'views_natural_sort_test_content',
'title' => 'Red and Blue',
]);
$node3
->save();
$view = Views::getView('views_natural_sort_test');
$view
->setDisplay();
$view
->preview('default');
$this
->assertIdenticalResultset($view, [
[
'title' => 'Red and Blue',
],
[
'title' => 'Red or Green',
],
[
'title' => 'Red of Purple',
],
], [
'title' => 'title',
]);
}