'Jane', 'last_name' => 'Doe', ], [ 'first_name' => 'John', 'last_name' => 'Doe', ], [ 'first_name' => 'Ben', 'last_name' => 'Smith', ], ]; return $retarr; } /** * Return large dataset to test performance. * @param int $max_size * @param int $delay * @param string $progress_bar_id UUID * @return array */ function getLargeDataSet( $max_size = 100, $delay = 100000, $progress_bar_id = null ) { if ( $max_size > 9999 ) { $max_size = 9999; } if ( $progress_bar_id == '' ) { $progress_bar_id = $this->getAPIMessageID(); } $this->getProgressBarObject()->start( $progress_bar_id, $max_size ); $retarr = []; for ( $i = 1; $i <= $max_size; $i++ ) { $retarr[] = [ 'foo1' => 'bar1', 'foo2' => 'bar2', 'foo3' => 'bar3' ]; usleep( $delay ); $this->getProgressBarObject()->set( $progress_bar_id, $i ); } $this->getProgressBarObject()->stop( $progress_bar_id ); return $retarr; } /** * Date test, since Flex doesn't handle timezones very well, run tests to ensure things are working correctly. * @param int $test * @return array */ function dateTest( $test = 1 ) { $retarr = []; switch ( $test ) { case 1: $retarr = [ strtotime( '30-Oct-09 5:00PM' ) => TTDate::getDBTimeStamp( strtotime( '30-Oct-09 5:00PM' ) ), strtotime( '31-Oct-09 5:00PM' ) => TTDate::getDBTimeStamp( strtotime( '31-Oct-09 5:00PM' ) ), strtotime( '01-Nov-09 5:00PM' ) => TTDate::getDBTimeStamp( strtotime( '01-Nov-09 5:00PM' ) ), strtotime( '02-Nov-09 5:00PM' ) => TTDate::getDBTimeStamp( strtotime( '02-Nov-09 5:00PM' ) ), ]; break; case 2: $retarr = [ strtotime( '30-Oct-09 5:00PM' ) => TTDate::getFlexTimeStamp( strtotime( '30-Oct-09 5:00PM' ) ), strtotime( '31-Oct-09 5:00PM' ) => TTDate::getFlexTimeStamp( strtotime( '31-Oct-09 5:00PM' ) ), strtotime( '01-Nov-09 5:00PM' ) => TTDate::getFlexTimeStamp( strtotime( '01-Nov-09 5:00PM' ) ), strtotime( '02-Nov-09 5:00PM' ) => TTDate::getFlexTimeStamp( strtotime( '02-Nov-09 5:00PM' ) ), ]; break; } return $retarr; } } ?>