Skip to content

Commit

Permalink
add test for geolonia_gis_load_textdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
naogify committed Jul 1, 2024
1 parent 346b4fa commit 7596f9d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 28 deletions.
11 changes: 4 additions & 7 deletions geolonia-open-gis.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,10 @@

require_once( dirname( __FILE__) . '/inc/functions.php' );

add_action( 'plugins_loaded', function() {
load_plugin_textdomain(
"geolonia-open-gis",
false,
dirname( plugin_basename( __FILE__ ) ).'/languages'
);
} );
function geolonia_gis_load_textdomain() {
load_plugin_textdomain( 'geolonia-open-gis', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
add_action( 'plugins_loaded', 'geolonia_gis_load_textdomain');

// Registers the custom post type `maps`.
add_action( 'init', function() {
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<testsuites>
<testsuite name="testing">
<directory prefix="test-" suffix=".php">./tests/</directory>
<exclude>./tests/test-sample.php</exclude>
</testsuite>
</testsuites>
</phpunit>
16 changes: 16 additions & 0 deletions tests/test-load-textdomain.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* Class TestLoadTextdomain
*
* @package Geolonia_Gis
*/

class TestLoadTextdomain extends WP_UnitTestCase {

/**
* Test load_textdomain
*/
public function test_load_textdomain() {
$this->assertTrue( geolonia_gis_load_textdomain() );
}
}
20 changes: 0 additions & 20 deletions tests/test-sample.php

This file was deleted.

0 comments on commit 7596f9d

Please sign in to comment.