Last active
November 23, 2018 12:34
-
-
Save opdavies/eb262d54f6075085d83b0fdb67185070 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Tests Simple Smartling's path functionality. | |
*/ | |
class SimpleSmartlingPathTest extends DrupalWebTestCase { | |
/** | |
* Implements getInfo(). | |
*/ | |
public function getInfo() { | |
return array( | |
'name' => 'Simple Smartling path tests', | |
'description' => '', | |
'group' => 'Simple Smartling', | |
); | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
protected function setUp() { | |
parent::setUp(array('simple_smartling')); | |
} | |
public function testAliasedPath() { | |
$account = $this->drupalCreateUser(array('administer simple smartling')); | |
$this->drupalLogin($account); | |
$edit = array('simple_smartling_no_translate_path' => 'foo'); | |
$this->drupalPost(SIMPLE_SMARTLING_ADMIN_SETTINGS_PATH, $edit, 'Save configuration'); | |
$settings = array('path' => array('alias' => 'foo')); | |
$this->drupalCreateNode($settings); | |
$this->drupalGet('node/1'); | |
$paths = variable_get('simple_smartling_no_translate_path', array()); | |
var_dump(array( | |
$_GET['q'], | |
'current path' => current_path(), | |
'alias' => drupal_get_path_alias(), | |
'paths' => $paths, | |
'match' => drupal_match_path(drupal_get_path_alias(), $paths), | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment