From 1e1ac57375b16cf45257e9155cf5a21b488874c0 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Sun, 24 Jan 2016 15:25:11 +0000 Subject: [PATCH] i18n tools: Add a test for the add-textdomain.php script. git-svn-id: https://develop.svn.wordpress.org/trunk@36389 602fd350-edb4-49c9-b593-d223f7449a82 --- tools/i18n/t/AddTextdomainTest.php | 24 +++++++++++++++++++ tools/i18n/t/data/add-textdomain-0-result.php | 17 +++++++++++++ tools/i18n/t/data/add-textdomain-0.php | 17 +++++++++++++ 3 files changed, 58 insertions(+) create mode 100755 tools/i18n/t/AddTextdomainTest.php create mode 100755 tools/i18n/t/data/add-textdomain-0-result.php create mode 100755 tools/i18n/t/data/add-textdomain-0.php diff --git a/tools/i18n/t/AddTextdomainTest.php b/tools/i18n/t/AddTextdomainTest.php new file mode 100755 index 0000000000..1c991dd363 --- /dev/null +++ b/tools/i18n/t/AddTextdomainTest.php @@ -0,0 +1,24 @@ +atd = new AddTextdomain; + } + + function test_add() { + # copy to a new file, so that we don't corrupt the old one + copy( 'data/add-textdomain-0.php', 'data/add-textdomain-0-work.php' ); + $this->atd->process_file( 'test-domain', 'data/add-textdomain-0-work.php', true ); + $this->assertEquals( file_get_contents( 'data/add-textdomain-0-result.php' ), file_get_contents( 'data/add-textdomain-0-work.php' ) ); + unlink( 'data/add-textdomain-0-work.php' ); + } +} diff --git a/tools/i18n/t/data/add-textdomain-0-result.php b/tools/i18n/t/data/add-textdomain-0-result.php new file mode 100755 index 0000000000..4c20cb890e --- /dev/null +++ b/tools/i18n/t/data/add-textdomain-0-result.php @@ -0,0 +1,17 @@ +