mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-06 01:10:04 +00:00
Move PHPUnit tests into a tests/phpunit directory.
wp-tests-config.php can/should reside in the root of a develop checkout. `phpunit` should be run from the root. see #25088. git-svn-id: https://develop.svn.wordpress.org/trunk@25165 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
35
tests/phpunit/tests/export/functions.export.php
Normal file
35
tests/phpunit/tests/export/functions.export.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Test export functions
|
||||
*
|
||||
* @group export
|
||||
* @ticket 22435
|
||||
*/
|
||||
class Test_WP_Export_Functions extends WP_UnitTestCase {
|
||||
function test_wp_export_returns_wp_error_if_the_writer_throws_Export_exception() {
|
||||
$this->assertTrue( is_wp_error( wp_export( array( 'writer' => 'Test_WP_Export_Stub_Writer_Throws_Export_Exception' ) ) ) );
|
||||
}
|
||||
|
||||
function test_wp_export_passes_the_exception_if_the_writer_throws_other_exception() {
|
||||
$this->setExpectedException( 'Exception' );
|
||||
wp_export( array( 'writer' => 'Test_WP_Export_Stub_Writer_Throws_Other_Exception' ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Test_WP_Export_Stub_Writer_Throws_Export_Exception {
|
||||
function __construct( $formatter ) {
|
||||
}
|
||||
function export() {
|
||||
throw new WP_Export_Exception( 'baba' );
|
||||
}
|
||||
}
|
||||
|
||||
class Test_WP_Export_Stub_Writer_Throws_Other_Exception {
|
||||
function __construct( $formatter ) {
|
||||
}
|
||||
function export() {
|
||||
throw new Exception( 'baba' );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user