Skip to content

Instantly share code, notes, and snippets.

@paulgibbs
Created October 28, 2014 05:45
Show Gist options
  • Save paulgibbs/77213ac6984e5ee19310 to your computer and use it in GitHub Desktop.
Save paulgibbs/77213ac6984e5ee19310 to your computer and use it in GitHub Desktop.
diff --git a/tests/phpunit/testcases/routing/core.php b/tests/phpunit/testcases/routing/core.php
index 519411e..90ba0b5 100644
--- a/tests/phpunit/testcases/routing/core.php
+++ b/tests/phpunit/testcases/routing/core.php
@@ -28,4 +28,21 @@ class BP_Tests_Routing_Core extends BP_UnitTestCase {
$this->assertArrayHasKey( 'activity', buddypress()->bp_nav );
$this->assertArrayHasKey( 'profile', buddypress()->bp_nav );
}
+
+ public function test_case_insensitivity_of_router_slugs() {
+ $this->go_to( bp_get_root_domain() . '/' . strtoupper( bp_get_activity_root_slug() ) . '/' );
+ $this->assertTrue( bp_is_activity_directory() );
+ }
+
+ public function test_case_insensitivity_of_urlencoded_router_slugs() {
+ $slug = '그룹전공서적';
+ $url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . rawurlencode( $slug ) . '/';
+
+ $g = $this->factory->group->create( array(
+ 'slug' => sanitize_title( $slug ),
+ ) );
+
+ $this->go_to( $url );
+ $this->assertTrue( bp_is_group() );
+ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment