mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Fixes #26248. git-svn-id: https://develop.svn.wordpress.org/trunk@26370 602fd350-edb4-49c9-b593-d223f7449a82
29 lines
867 B
PHP
29 lines
867 B
PHP
<?php
|
|
|
|
/**
|
|
* Test WP_Export_*_Writer classes
|
|
*
|
|
* @group export
|
|
* @ticket 22435
|
|
*/
|
|
class Test_WP_Export_Writers extends WP_UnitTestCase {
|
|
function test_export_returner_returns_all_the_return_values() {
|
|
if ( ! class_exists( 'WP_Export_Returner' ) ) {
|
|
$this->markTestSkipped( "WP_Export_Returner class doesn't exist" );
|
|
}
|
|
$returner = new WP_Export_Returner( $this->get_x_formatter() );
|
|
$this->assertEquals( 'xxx' , $returner->export() );
|
|
}
|
|
|
|
private function get_x_formatter() {
|
|
$methods = array( 'before_posts', 'posts', 'after_posts' );
|
|
$formatter = $this->getMock( 'WP_Export_WXR_Formatter', $methods, array( null ) );
|
|
foreach( $methods as $method ) {
|
|
$return = 'posts' == $method? array( 'x' ) : 'x';
|
|
$formatter->expects( $this->once() )->method( $method )->with()->will( $this->returnValue( $return ) );
|
|
}
|
|
return $formatter;
|
|
}
|
|
}
|
|
|