class PhotosAlbumTest in Album Photos 8.4
Same name and namespace in other branches
- 8.5 tests/src/Unit/PhotosAlbumTest.php \Drupal\Tests\photos\Unit\PhotosAlbumTest
- 6.0.x tests/src/Unit/PhotosAlbumTest.php \Drupal\Tests\photos\Unit\PhotosAlbumTest
@coversDefaultClass \Drupal\photos\PhotosAlbum @group photos
Hierarchy
- class \Drupal\Tests\photos\Unit\PhotosAlbumTest extends \PHPUnit\Framework\TestCase
Expanded class hierarchy of PhotosAlbumTest
File
- tests/
src/ Unit/ PhotosAlbumTest.php, line 12
Namespace
Drupal\Tests\photos\UnitView source
class PhotosAlbumTest extends TestCase {
/**
* Data provider for testOrderValueChange.
*/
public function orderValueChangeProvider() {
return [
[
'weight',
'asc',
[
'column' => 'p.wid',
'sort' => 'asc',
],
],
[
'filesize',
'asc',
[
'column' => 'f.filesize',
'sort' => 'asc',
],
],
[
'test',
'test',
[
'column' => 'f.fid',
'sort' => 'desc',
],
],
];
}
/**
* @covers ::orderValueChange
* @dataProvider orderValueChangeProvider
*/
public function testOrderValueChange($field, $sort, $expected_result) {
$this
->assertSame($expected_result, PhotosAlbum::orderValueChange($field, $sort));
}
/**
* Data provider for testOrderValue.
*/
public function orderValueProvider() {
return [
[
'weight',
'asc',
0,
0,
[
'order' => [
'column' => 'p.wid',
'sort' => 'asc',
],
],
],
[
0,
0,
0,
[
'column' => 'f.filesize',
'sort' => 'asc',
],
[
'order' => [
'column' => 'f.filesize',
'sort' => 'asc',
],
],
],
[
0,
0,
0,
0,
[
'order' => [
'column' => 'f.fid',
'sort' => 'desc',
],
],
],
];
}
/**
* @covers ::orderValue
* @dataProvider orderValueProvider
*/
public function testOrderValue($field, $sort, $limit, $default, $expected_result) {
$this
->assertSame($expected_result, PhotosAlbum::orderValue($field, $sort, $limit, $default));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PhotosAlbumTest:: |
public | function | Data provider for testOrderValueChange. | |
PhotosAlbumTest:: |
public | function | Data provider for testOrderValue. | |
PhotosAlbumTest:: |
public | function | @covers ::orderValue @dataProvider orderValueProvider | |
PhotosAlbumTest:: |
public | function | @covers ::orderValueChange @dataProvider orderValueChangeProvider |