Loading core/lib/Drupal/Core/Pager/PagerPreprocess.php +1 −1 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ public function preprocessPager(array &$variables): void { } $items['last'] = []; $items['last']['attributes'] = new Attribute(); $items['last']['attributes'] = new Attribute($link_attributes); $options = [ 'query' => $this->pagerManager->getUpdatedParameters($parameters, $element, $pager_max - 1), ]; Loading core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php +4 −4 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ protected function setUp(): void { ->disableOriginalConstructor() ->getMock(); $pager->method('getTotalPages')->willReturn(2); $pager->method('getTotalPages')->willReturn(3); $pager->method('getCurrentPage')->willReturn(1); $url_generator->method('generateFromRoute')->willReturn(''); Loading Loading @@ -83,7 +83,7 @@ public function testQuantityNotSet(): void { ]; $this->pagerPreprocess->preprocessPager($variables); $this->assertEquals(['first', 'previous'], array_keys($variables['items'])); $this->assertEquals(['first', 'previous', 'next', 'last'], array_keys($variables['items'])); } /** Loading @@ -103,7 +103,7 @@ public function testQuantitySet(): void { ]; $this->pagerPreprocess->preprocessPager($variables); $this->assertEquals(['first', 'previous', 'pages'], array_keys($variables['items'])); $this->assertEquals(['first', 'previous', 'pages', 'next', 'last'], array_keys($variables['items'])); /** @var \Drupal\Core\Template\AttributeString $attribute */ $attribute = $variables['items']['pages']['2']['attributes']->offsetGet('aria-current'); $this->assertInstanceOf(AttributeString::class, $attribute); Loading Loading @@ -208,7 +208,7 @@ public function testPagerModalAttributes(): void { ]; $this->pagerPreprocess->preprocessPager($variables); foreach (['first', 'previous'] as $key) { foreach (['first', 'previous', 'next', 'last'] as $key) { $attributes = $variables['items'][$key]['attributes']->toArray(); $this->assertEquals(['use-ajax'], $attributes['class']); } Loading Loading
core/lib/Drupal/Core/Pager/PagerPreprocess.php +1 −1 Original line number Diff line number Diff line Loading @@ -160,7 +160,7 @@ public function preprocessPager(array &$variables): void { } $items['last'] = []; $items['last']['attributes'] = new Attribute(); $items['last']['attributes'] = new Attribute($link_attributes); $options = [ 'query' => $this->pagerManager->getUpdatedParameters($parameters, $element, $pager_max - 1), ]; Loading
core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php +4 −4 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ protected function setUp(): void { ->disableOriginalConstructor() ->getMock(); $pager->method('getTotalPages')->willReturn(2); $pager->method('getTotalPages')->willReturn(3); $pager->method('getCurrentPage')->willReturn(1); $url_generator->method('generateFromRoute')->willReturn(''); Loading Loading @@ -83,7 +83,7 @@ public function testQuantityNotSet(): void { ]; $this->pagerPreprocess->preprocessPager($variables); $this->assertEquals(['first', 'previous'], array_keys($variables['items'])); $this->assertEquals(['first', 'previous', 'next', 'last'], array_keys($variables['items'])); } /** Loading @@ -103,7 +103,7 @@ public function testQuantitySet(): void { ]; $this->pagerPreprocess->preprocessPager($variables); $this->assertEquals(['first', 'previous', 'pages'], array_keys($variables['items'])); $this->assertEquals(['first', 'previous', 'pages', 'next', 'last'], array_keys($variables['items'])); /** @var \Drupal\Core\Template\AttributeString $attribute */ $attribute = $variables['items']['pages']['2']['attributes']->offsetGet('aria-current'); $this->assertInstanceOf(AttributeString::class, $attribute); Loading Loading @@ -208,7 +208,7 @@ public function testPagerModalAttributes(): void { ]; $this->pagerPreprocess->preprocessPager($variables); foreach (['first', 'previous'] as $key) { foreach (['first', 'previous', 'next', 'last'] as $key) { $attributes = $variables['items'][$key]['attributes']->toArray(); $this->assertEquals(['use-ajax'], $attributes['class']); } Loading