\Dewdrop\Fields\TestListingSort

This utility can test the sorting capabilities of a Listing and Fields object. It will iterate over each sortable field and attempt to fetch data from the Listing after you sort in both ascending and descending order. You can also use this utility in the context of a PHPUnit test case to automate the testing of your Listing's sorting.

Summary

Methods
Properties
Constants
__construct()
testSortHelperPresence()
runOnSingleField()
run()
runInPhpUnit()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$sortHelper
N/A

Properties

Methods

__construct()

__construct(\Dewdrop\Fields  $fields, \Dewdrop\Fields\Listing  $listing) 

Provide the Fields and Listing objects that will be tested.

Parameters

\Dewdrop\Fields $fields
\Dewdrop\Fields\Listing $listing

Throws

\Dewdrop\Fields\Exception

testSortHelperPresence()

testSortHelperPresence() 

Ensure the sort helper is present on the Listing.

Throws

\Dewdrop\Fields\Exception

runOnSingleField()

runOnSingleField(\Dewdrop\Fields\FieldInterface  $field) : array

Sort the listing in both ascending and descending order for the supplied field, catching any exceptions if the sorted query causes a problem.

Parameters

\Dewdrop\Fields\FieldInterface $field

Returns

array

run()

run() : array

Run tests on all the available fields.

Returns

array

runInPhpUnit()

runInPhpUnit(\PHPUnit_Framework_TestCase  $phpUnit) 

Run the tests on all available fields and communicate the results to PHPUnit using assertions.

Parameters

\PHPUnit_Framework_TestCase $phpUnit