Chris@0: 1, Chris@0: 'title' => 'Item 1', Chris@0: 'changed' => 1, Chris@0: ], Chris@0: [ Chris@0: 'id' => 2, Chris@0: 'title' => 'Item 2', Chris@0: 'changed' => 2, Chris@0: ], Chris@0: [ Chris@0: 'id' => 3, Chris@0: 'title' => 'Item 3', Chris@0: 'changed' => 3, Chris@0: ], Chris@0: ]; Chris@0: Chris@0: // The expected results. Chris@0: $tests[0]['expected_data'] = [ Chris@0: [ Chris@0: 'id' => 2, Chris@0: 'title' => 'Item 2', Chris@0: 'changed' => 2, Chris@0: ], Chris@0: [ Chris@0: 'id' => 3, Chris@0: 'title' => 'Item 3', Chris@0: 'changed' => 3, Chris@0: ], Chris@0: ]; Chris@0: Chris@0: // The expected count is the count returned by the query before the query Chris@0: // is modified by SqlBase::initializeIterator(). Chris@0: $tests[0]['expected_count'] = 3; Chris@0: $tests[0]['configuration'] = [ Chris@0: 'high_water_property' => [ Chris@0: 'name' => 'changed', Chris@0: ], Chris@0: ]; Chris@0: $tests[0]['high_water'] = $tests[0]['source_data']['high_water_node'][0]['changed']; Chris@0: Chris@0: // Test high water initialized to NULL. Chris@0: $tests[1]['source_data'] = $tests[0]['source_data']; Chris@0: $tests[1]['expected_data'] = [ Chris@0: [ Chris@0: 'id' => 1, Chris@0: 'title' => 'Item 1', Chris@0: 'changed' => 1, Chris@0: ], Chris@0: [ Chris@0: 'id' => 2, Chris@0: 'title' => 'Item 2', Chris@0: 'changed' => 2, Chris@0: ], Chris@0: [ Chris@0: 'id' => 3, Chris@0: 'title' => 'Item 3', Chris@0: 'changed' => 3, Chris@0: ], Chris@0: ]; Chris@0: $tests[1]['expected_count'] = $tests[0]['expected_count']; Chris@0: $tests[1]['configuration'] = $tests[0]['configuration']; Chris@0: $tests[1]['high_water'] = NULL; Chris@0: Chris@0: // Test high water initialized to an empty string. Chris@0: $tests[2]['source_data'] = $tests[0]['source_data']; Chris@0: $tests[2]['expected_data'] = [ Chris@0: [ Chris@0: 'id' => 1, Chris@0: 'title' => 'Item 1', Chris@0: 'changed' => 1, Chris@0: ], Chris@0: [ Chris@0: 'id' => 2, Chris@0: 'title' => 'Item 2', Chris@0: 'changed' => 2, Chris@0: ], Chris@0: [ Chris@0: 'id' => 3, Chris@0: 'title' => 'Item 3', Chris@0: 'changed' => 3, Chris@0: ], Chris@0: ]; Chris@0: $tests[2]['expected_count'] = $tests[0]['expected_count']; Chris@0: $tests[2]['configuration'] = $tests[0]['configuration']; Chris@0: $tests[2]['high_water'] = ''; Chris@0: Chris@0: return $tests; Chris@0: } Chris@0: Chris@0: }