<?php

namespace OpenCFP\Test\Domain\Services;

use OpenCFP\Domain\Services\Pagination;
use OpenCFP\Test\BaseTestCase;
use Pagerfanta\Pagerfanta;

class PaginationTest extends BaseTestCase
{
    /**
     * @var Pagination
     */
    private $pagination;
    public function setUp()
    {
        parent::setUp();
        $this->pagination = new Pagination([1,2,3,4,5,6,7,8,9,10],2);
    }

    /**
     * @test
     */
    public function currentPageGetterAndSetterWork()
    {
        $this->pagination->setCurrentPage(null);
        $this->assertSame(1, $this->pagination->getCurrentPage());
        $this->pagination->setCurrentPage('');
        $this->assertSame(1, $this->pagination->getCurrentPage());
        $this->pagination->setCurrentPage(2);
        $this->assertSame(2, $this->pagination->getCurrentPage());
    }

    /**
     * @test
     */
    public function getFantaWorks()
    {
        $this->assertInstanceOf(Pagerfanta::class, $this->pagination->getFanta());
    }

    /**
     * @test
     */
    public function createViewWorks()
    {
        $view = $this->pagination->createView('/help/example?');
        $this->assertContains('/help/example?', $view);
        $this->assertContains('page=2', $view);

        $otherView = $this->pagination->createView('/help/example?',['filter' => 'bam']);
        $this->assertContains('/help/example?', $otherView);
        $this->assertContains('page=2', $otherView);
        $this->assertContains('filter=bam', $otherView);

    }


}

Add a test for pagination
Add a test for pagination

This class didn't have its own tests yet, and all coverage of it was
from the controller tests.
