Commit e78f51fe authored by Mateu Aguiló Bosch's avatar Mateu Aguiló Bosch
Browse files

Remove some old tests

parent a797ffbb
<?php
/**
* @file
* Contains \Drupal\typed_entity\Tests\TypedEntityUnitTestCase
*/
namespace Drupal\typed_entity\Tests;
use Drupal\typed_entity\Exception\TypedEntityException;
use Drupal\typed_entity\TypedEntity\TypedEntity;
class TypedEntityUnitTestCase extends \DrupalUnitTestCase {
/**
* Declare test information.
*
* @return array
* The information array.
*/
public static function getInfo() {
return array(
'name' => 'Typed entity',
'description' => 'Unit tests for Typed Entity.',
'group' => 'Typed Entity',
);
}
/**
* Test logging message.
*/
public function __testConstructor() {
require_once __DIR__ . '/../../../../src/TypedEntity/TypedEntity.php';
require_once __DIR__ . '/../../../../src/Exception/TypedEntityException.php';
try {
new TypedEntity(NULL, 1);
$this->fail('Exception was not thrown for missing entity type.');
}
catch (TypedEntityException $e) {
$this->pass('Exception was thrown for missing entity type.');
}
try {
new TypedEntity('foo');
$this->fail('Exception was not thrown for missing entity and ID.');
}
catch (TypedEntityException $e) {
$this->pass('Exception was thrown for missing entity and ID.');
}
}
}
<?php
/**
* @file
* Contains \Drupal\typed_entity_example\Tests\TypedEntityExampleUnitTestCase
*/
namespace Drupal\typed_entity_example\Tests;
use Drupal\typed_entity\TypedEntity\TypedEntityManager;
use Drupal\typed_entity_example\TypedEntity\Tests\TypedNodeArticleUnitTest;
class TypedEntityExampleUnitTestCase extends \DrupalUnitTestCase {
/**
* Declare test information.
*
* @return array
* The information array.
*/
public static function getInfo() {
return array(
'name' => 'Typed entity example (unit)',
'description' => 'Shows an example of how you can do unit testing of your code.',
'group' => 'Typed Entity',
);
}
/**
* Test logging message.
*/
public function __testLoggingMessage() {
require_once __DIR__ . '/../../../../src/TypedEntity/Tests/TypedNodeArticleUnitTest.php';
$typed_article = new TypedNodeArticleUnitTest('node', 1, NULL, 'article');
$this->assertEqual($typed_article->getLoggingMessage(), 'User with id 1. Node with title Foo. Status 1.', 'Logging message is successful.');
}
/**
* Test camelize method.
*/
public function __testCamelize() {
require_once __DIR__ . '/../../../../../../src/TypedEntity/TypedEntityManager.php';
$this->assertEqual(TypedEntityManager::camelize('abc_def-ghi'), 'AbcDefGhi');
$this->assertEqual(TypedEntityManager::camelize('1234'), '1234');
$this->assertEqual(TypedEntityManager::camelize('1-a>234'), '1A>234');
$this->assertEqual(TypedEntityManager::camelize(''), '');
}
}
......@@ -146,7 +146,7 @@ class TypedEntityManager implements TypedEntityManagerInterface {
$module_list = static::$serviceContainer
->get('module_handler')
->getModuleList();
foreach ($module_list as $module_name) {
foreach (array_keys($module_list) as $module_name) {
$names[] = '\\Drupal\\' . $module_name . '\\TypedEntity\\' . $class_name_entity_type;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment