Tests simple argument.
public function testSimpleArgument() {
// Execute with a view
$view = views_get_view('test_simple_argument');
$view
->setArguments(array(
27,
));
$this
->executeView($view);
// Build the expected result.
$dataset = array(
array(
'id' => 2,
'name' => 'George',
'age' => 27,
),
);
// Verify the result.
$this
->assertEqual(1, count($view->result), t('The number of returned rows match.'));
$this
->assertIdenticalResultSet($view, $dataset, array(
'views_test_data_name' => 'name',
'views_test_data_age' => 'age',
));
// Test "show all" if no argument is present.
$view = views_get_view('test_simple_argument');
$this
->executeView($view);
// Build the expected result.
$dataset = $this
->dataSet();
$this
->assertEqual(5, count($view->result), t('The number of returned rows match.'));
$this
->assertIdenticalResultSet($view, $dataset, array(
'views_test_data_name' => 'name',
'views_test_data_age' => 'age',
));
}