You are here

public static function ViewTestData::dataSet in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/ViewTestData.php \Drupal\views\Tests\ViewTestData::dataSet()

Returns a very simple test dataset.

3 calls to ViewTestData::dataSet()
CounterTest::setUp in core/modules/views/tests/src/Unit/Plugin/field/CounterTest.php
ViewKernelTestBase::dataSet in core/modules/views/src/Tests/ViewKernelTestBase.php
Returns a very simple test dataset.
ViewTestBase::dataSet in core/modules/views/src/Tests/ViewTestBase.php
Returns a very simple test dataset.

File

core/modules/views/src/Tests/ViewTestData.php, line 236
Contains \Drupal\views\Tests\ViewTestData.

Class

ViewTestData
Provides tests view data and the base test schema with sample data records.

Namespace

Drupal\views\Tests

Code

public static function dataSet() {
  return array(
    array(
      'name' => 'John',
      'age' => 25,
      'job' => 'Singer',
      'created' => gmmktime(0, 0, 0, 1, 1, 2000),
      'status' => 1,
    ),
    array(
      'name' => 'George',
      'age' => 27,
      'job' => 'Singer',
      'created' => gmmktime(0, 0, 0, 1, 2, 2000),
      'status' => 0,
    ),
    array(
      'name' => 'Ringo',
      'age' => 28,
      'job' => 'Drummer',
      'created' => gmmktime(6, 30, 30, 1, 1, 2000),
      'status' => 1,
    ),
    array(
      'name' => 'Paul',
      'age' => 26,
      'job' => 'Songwriter',
      'created' => gmmktime(6, 0, 0, 1, 1, 2000),
      'status' => 0,
    ),
    array(
      'name' => 'Meredith',
      'age' => 30,
      'job' => 'Speaker',
      'created' => gmmktime(6, 30, 10, 1, 1, 2000),
      'status' => 1,
    ),
  );
}