Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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