public function testGetFilteredNodesInOrderByTitle()
{
$data = [['title' => 'hello you', 'tags' => ['tag1', 'tag2'], 'url' => '/news/test1', 'article' => 'Test'], ['title' => 'Hello me', 'tags' => ['tag1', 'tag2'], 'url' => '/news/test2', 'article' => 'Test'], ['title' => 'Test', 'tags' => ['tag1', 'tag2'], 'url' => '/news/test3', 'article' => 'Test']];
foreach ($data as &$element) {
$element = $this->mapper->save($element, 'overview', 'sulu_io', 'en', 1, true, null, null, StructureInterface::STATE_PUBLISHED);
sleep(1);
}
$nodes = $this->nodeRepository->getFilteredNodes(['sortBy' => ['title'], 'sortMethod' => 'asc'], 'en', 'sulu_io');
$this->assertEquals('Hello me', $nodes[0]['title']);
$this->assertEquals('hello you', $nodes[1]['title']);
$this->assertEquals('Test', $nodes[2]['title']);
$nodes = $this->nodeRepository->getFilteredNodes(['sortBy' => ['title'], 'sortMethod' => 'desc'], 'en', 'sulu_io');
$this->assertEquals('Hello me', $nodes[2]['title']);
$this->assertEquals('hello you', $nodes[1]['title']);
$this->assertEquals('Test', $nodes[0]['title']);
}