Skip to content

Commit

Permalink
Rename local_tasks.yml, replaced removed functions, updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Berdir committed Jul 17, 2014
1 parent c97938c commit 1989b8a
Show file tree
Hide file tree
Showing 23 changed files with 144 additions and 135 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ script:
- cd $TRAVIS_BUILD_DIR/../drupal
- ls -la $TRAVIS_BUILD_DIR/../drupal/sites/default
# Run the tests
- php core/scripts/run-tests.sh --verbose --color --concurrency 4 --php `which php` --url http://localhost "Token" | tee /tmp/test.txt
- php core/scripts/run-tests.sh --verbose --color --concurrency 4 --php `which php` --url http://localhost "token" | tee /tmp/test.txt
- TEST_EXIT=${PIPESTATUS[0]}
- echo $TEST_EXIT
# Check if we had fails in the run-tests.sh script
Expand Down
9 changes: 1 addition & 8 deletions src/Tests/TokenArrayTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,9 @@
/**
* Tests array tokens.
*
* @group Token
* @group token
*/
class TokenArrayTestCase extends TokenTestBase {
public static function getInfo() {
return array(
'name' => 'Array token tests',
'description' => 'Test the array tokens.',
'group' => 'Token',
);
}

function testArrayTokens() {
// Test a simple array.
Expand Down
21 changes: 11 additions & 10 deletions src/Tests/TokenBlockTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@
/**
* Tests block tokens.
*
* @group Token
* @group token
*/
class TokenBlockTestCase extends TokenTestBase {
protected static $modules = array('path', 'token', 'token_test', 'block', 'node', 'views', 'block_content');

public static function getInfo() {
return array(
'name' => 'Block token tests',
'description' => 'Test the block title token replacement.',
'group' => 'Token',
);
}
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = array('path', 'token', 'token_test', 'block', 'node', 'views', 'block_content');

/**
* {@inheritdoc}
*/
public function setUp($modules = array()) {
parent::setUp();
$this->admin_user = $this->drupalCreateUser(array('access content', 'administer blocks'));
Expand Down Expand Up @@ -63,7 +64,7 @@ public function testBlockTitleTokens() {
// Ensure that tokens are not double-escaped when output as a block title.
$node = $this->drupalCreateNode(array('title' => "Site's first node"));
$this->drupalGet('node/' . $node->id());
// The apostraphe should only be escaped once via check_plain().
// The apostraphe should only be escaped once via \Drupal\Component\Utility\String::checkPlain().
$this->assertRaw("Site's first node block title");
}
}
10 changes: 1 addition & 9 deletions src/Tests/TokenCommentTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,11 @@
/**
* Tests comment tokens.
*
* @group Token
* @group token
*/
class TokenCommentTestCase extends TokenTestBase {
protected static $modules = array('path', 'token', 'token_test', 'node', 'comment');

public static function getInfo() {
return array(
'name' => 'Comment token tests',
'description' => 'Test the comment tokens.',
'group' => 'Token',
);
}

function testCommentTokens() {
$this->drupalCreateContentType(array('type' => 'page', 'name' => t('Page')));
\Drupal::service('comment.manager')->addDefaultField('node', 'page');
Expand Down
12 changes: 2 additions & 10 deletions src/Tests/TokenCurrentPageTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,14 @@
namespace Drupal\token\Tests;

/**
* Tests current page tokens.
* Test the [current-page:*] tokens.
*
* @group Token
* @group token
*/
class TokenCurrentPageTestCase extends TokenTestBase {

protected static $modules = array('path', 'token', 'token_test', 'node');

public static function getInfo() {
return array(
'name' => 'Current page token tests',
'description' => 'Test the [current-page:*] tokens.',
'group' => 'Token',
);
}

function testCurrentPageTokens() {
$this->drupalGet('user');
$tokens = array(
Expand Down
9 changes: 1 addition & 8 deletions src/Tests/TokenDateTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,9 @@
/**
* Tests date tokens.
*
* @group Token
* @group token
*/
class TokenDateTestCase extends TokenTestBase {
public static function getInfo() {
return array(
'name' => 'Date token tests',
'description' => 'Test the date tokens.',
'group' => 'Token',
);
}

function testDateTokens() {
$tokens = array(
Expand Down
11 changes: 3 additions & 8 deletions src/Tests/TokenEntityTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@
class TokenEntityTestCase extends TokenTestBase {
protected static $modules = array('path', 'token', 'token_test', 'node', 'taxonomy');

public static function getInfo() {
return array(
'name' => 'Entity token tests',
'description' => 'Test the entity tokens.',
'group' => 'Token',
);
}

/**
* {@inheritdoc}
*/
public function setUp($modules = array()) {
parent::setUp();

Expand Down
10 changes: 1 addition & 9 deletions src/Tests/TokenFileTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,11 @@
/**
* Tests file tokens.
*
* @group Token
* @group token
*/
class TokenFileTestCase extends TokenTestBase {
protected static $modules = array('path', 'token', 'token_test', 'file');

public static function getInfo() {
return array(
'name' => 'File token tests',
'description' => 'Test the file tokens.',
'group' => 'Token',
);
}

function testFileTokens() {
// Create a test file object.
$file = entity_create('file', array(
Expand Down
10 changes: 1 addition & 9 deletions src/Tests/TokenMenuTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,11 @@
/**
* Tests menu tokens.
*
* @group Token
* @group token
*/
class TokenMenuTestCase extends TokenTestBase {
protected static $modules = array('path', 'token', 'token_test', 'menu_ui', 'node');

public static function getInfo() {
return array(
'name' => 'Menu link and menu token tests',
'description' => 'Test the menu tokens.',
'group' => 'Token',
);
}

function testMenuTokens() {
// Add a menu.
$menu = entity_create('menu', array(
Expand Down
13 changes: 3 additions & 10 deletions src/Tests/TokenNodeTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,17 @@
* @file
* Contains \Drupal\token\Tests\TokenNodeTestCase.
*/

namespace Drupal\token\Tests;

/**
* Tests node tokens.
* Test the node and content type tokens.
*
* @group Token
* @group token
*/
class TokenNodeTestCase extends TokenTestBase {
protected $profile = 'standard';

public static function getInfo() {
return array(
'name' => 'Node and content type token tests',
'description' => 'Test the node and content type tokens.',
'group' => 'Token',
);
}

function testNodeTokens() {
$source_node = $this->drupalCreateNode(array('log' => $this->randomName(), 'path' => array('alias' => 'content/source-node')));
$tokens = array(
Expand Down
9 changes: 1 addition & 8 deletions src/Tests/TokenRandomTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,9 @@
/**
* Tests random tokens.
*
* @group Token
* @group token
*/
class TokenRandomTestCase extends TokenTestBase {
public static function getInfo() {
return array(
'name' => 'Random token tests',
'description' => 'Test the random tokens.',
'group' => 'Token',
);
}

function testRandomTokens() {
$tokens = array(
Expand Down
13 changes: 4 additions & 9 deletions src/Tests/TokenTaxonomyTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,16 @@
/**
* Tests taxonomy tokens.
*
* @group Token
* @group token
*/
class TokenTaxonomyTestCase extends TokenTestBase {
protected $vocab;

protected static $modules = array('path', 'token', 'token_test', 'taxonomy');

public static function getInfo() {
return array(
'name' => 'Taxonomy and vocabulary token tests',
'description' => 'Test the taxonomy tokens.',
'group' => 'Token',
);
}

/**
* {@inheritdoc}
*/
public function setUp() {
parent::setUp();

Expand Down
13 changes: 4 additions & 9 deletions src/Tests/TokenURLTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,14 @@
/**
* Tests url tokens.
*
* @group Token
* @group token
*/
class TokenURLTestCase extends TokenTestBase {
protected static $modules = array('path', 'token', 'token_test', 'node');

public static function getInfo() {
return array(
'name' => 'URL token tests',
'description' => 'Test the URL tokens.',
'group' => 'Token',
);
}

/**
* {@inheritdoc}
*/
public function setUp() {
parent::setUp();
$this->saveAlias('node/1', 'first-node');
Expand Down
12 changes: 2 additions & 10 deletions src/Tests/TokenUnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,13 @@
namespace Drupal\token\Tests;

/**
* Token unit tests.
* Test basic, low-level token functions.
*
* @group Token
* @group token
*/
class TokenUnitTestCase extends TokenTestBase {
protected static $modules = array('path', 'token', 'token_test', 'file', 'node');

public static function getInfo() {
return array(
'name' => 'Token unit tests',
'description' => 'Test basic, low-level token functions.',
'group' => 'Token',
);
}

/**
* Test token_get_invalid_tokens() and token_get_invalid_tokens_by_context().
*/
Expand Down
24 changes: 12 additions & 12 deletions src/Tests/TokenUserTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
* @file
* Contains \Drupal\token\Tests\TokenUserTestCase.
*/

namespace Drupal\token\Tests;

use Drupal\Core\Session\AnonymousUserSession;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Field;

/**
* Tests user tokens.
*
* @group Token
* @group token
*/
class TokenUserTestCase extends TokenTestBase {
protected $account = NULL;

// User pictures only exist in standard now.
protected $profile = 'standard';

public static function getInfo() {
return array(
'name' => 'User token tests',
'description' => 'Test the user tokens.',
'group' => 'Token',
);
}
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = array('token_user_picture');

/**
* {@inheritdoc}
*/
public function setUp() {
parent::setUp();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
langcode: de
status: true
dependencies:
module:
- image
- user
id: user.user.default
targetEntityType: user
bundle: user
mode: default
content:
account:
weight: -10
user_picture:
type: image_image
settings:
progress_indicator: throbber
preview_image_style: thumbnail
third_party_settings: { }
weight: -1
timezone:
weight: 6
hidden: { }
Loading

0 comments on commit 1989b8a

Please sign in to comment.