2016-11-08 09:39:47 +00:00
|
|
|
<?php
|
2019-11-21 14:52:07 +00:00
|
|
|
/**
|
|
|
|
* Dummy WC data stores used to test data store functionality.
|
|
|
|
*
|
|
|
|
* @package WooCommerce\Tests\Framework
|
|
|
|
*/
|
|
|
|
|
2016-11-08 09:39:47 +00:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2019-11-21 14:52:07 +00:00
|
|
|
// phpcs:disable Squiz.Commenting
|
|
|
|
|
2016-11-08 09:39:47 +00:00
|
|
|
/**
|
|
|
|
* WC Dummy Data Store: CPT.
|
|
|
|
*
|
|
|
|
* Used to test swapping out data stores.
|
|
|
|
*
|
2017-03-15 16:36:53 +00:00
|
|
|
* @version 3.0.0
|
2016-11-08 09:39:47 +00:00
|
|
|
*/
|
2016-11-22 13:54:51 +00:00
|
|
|
class WC_Dummy_Data_Store_CPT implements WC_Object_Data_Store_Interface {
|
2016-11-08 09:39:47 +00:00
|
|
|
public function create( &$data ) { }
|
|
|
|
public function read( &$data ) { }
|
|
|
|
public function update( &$data ) { }
|
2016-11-15 18:11:25 +00:00
|
|
|
public function delete( &$data, $args = array() ) { }
|
2016-11-21 23:48:49 +00:00
|
|
|
public function read_meta( &$data ) { }
|
|
|
|
public function delete_meta( &$data, $meta ) { }
|
|
|
|
public function add_meta( &$data, $meta ) { }
|
|
|
|
public function update_meta( &$data, $meta ) { }
|
2019-11-21 14:52:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Method used to test WC_Data_Store::__call().
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function custom_method( $first_param, $second_param, $third_param ) {
|
|
|
|
return array( $first_param, $second_param, $third_param );
|
|
|
|
}
|
2016-11-08 09:39:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* WC Dummy Data Store: Custom Table.
|
|
|
|
*
|
|
|
|
* Used to test swapping out data stores.
|
|
|
|
*
|
2017-03-15 16:36:53 +00:00
|
|
|
* @version 3.0.0
|
2016-11-08 09:39:47 +00:00
|
|
|
*/
|
2016-11-22 13:54:51 +00:00
|
|
|
class WC_Dummy_Data_Store_Custom_Table implements WC_Object_Data_Store_Interface {
|
2016-11-08 09:39:47 +00:00
|
|
|
public function create( &$data ) { }
|
|
|
|
public function read( &$data ) { }
|
|
|
|
public function update( &$data ) { }
|
2016-11-15 18:11:25 +00:00
|
|
|
public function delete( &$data, $args = array() ) { }
|
2016-11-21 23:48:49 +00:00
|
|
|
public function read_meta( &$data ) { }
|
|
|
|
public function delete_meta( &$data, $meta ) { }
|
|
|
|
public function add_meta( &$data, $meta ) { }
|
|
|
|
public function update_meta( &$data, $meta ) { }
|
2016-11-08 09:39:47 +00:00
|
|
|
}
|
2019-11-21 14:52:07 +00:00
|
|
|
|
|
|
|
// phpcs:enable
|