Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439 Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
33 lines
846 B
PHP
33 lines
846 B
PHP
<?php
|
|
|
|
use Test\Tool\BaseTestCase;
|
|
use Knp\Component\Pager\Paginator;
|
|
use Symfony\Component\EventDispatcher\EventDispatcher;
|
|
use Knp\Component\Pager\Pagination\PaginationInterface;
|
|
use Knp\Component\Pager\Event\Subscriber\Paginate\PaginationSubscriber;
|
|
|
|
class PaginatorTest extends BaseTestCase
|
|
{
|
|
/**
|
|
* @test
|
|
* @expectedException RuntimeException
|
|
*/
|
|
function shouldNotBeAbleToPaginateWithoutListeners()
|
|
{
|
|
$p = new Paginator(new EventDispatcher);
|
|
$p->paginate(array());
|
|
}
|
|
|
|
/**
|
|
* @test
|
|
* @expectedException RuntimeException
|
|
*/
|
|
function shouldFailToPaginateUnsupportedValue()
|
|
{
|
|
$dispatcher = new EventDispatcher;
|
|
$dispatcher->addSubscriber(new PaginationSubscriber);
|
|
|
|
$p = new Paginator($dispatcher);
|
|
$view = $p->paginate(null, 1, 10);
|
|
}
|
|
} |