Wordpress/tests/phpunit/includes/factory/class-wp-unittest-factory-callback-after-create.php

30 lines
556 B
PHP
Raw Normal View History

<?php
class WP_UnitTest_Factory_Callback_After_Create {
/**
* @var callable
*/
var $callback;
/**
* WP_UnitTest_Factory_Callback_After_Create constructor.
*
* @param callable $callback A callback function.
*/
function __construct( $callback ) {
$this->callback = $callback;
}
/**
* Calls the set callback on given object.
*
* @param mixed $object The object to apply the callback on.
*
* @return mixed The possibly altered object.
*/
function call( $object ) {
return call_user_func( $this->callback, $object );
}
}