commit fd2f13a318fdca8784cff819c445374aa6dc76df
Author: Bart Feenstra <bart@mynameisbart.com>
Date:   Fri Nov 15 14:26:56 2013 +0100

    boo

diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityLabelTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityLabelTest.php
deleted file mode 100644
index 097c7bc..0000000
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityLabelTest.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\system\Tests\Entity\EntityLabelTest.
- */
-
-namespace Drupal\system\Tests\Entity;
-
-/**
- * Tests entity properties.
- */
-class EntityLabelTest extends EntityUnitTestBase {
-
-  public static function getInfo() {
-    return array(
-      'name' => 'Entity label',
-      'description' => 'Tests entity labels.',
-      'group' => 'Entity API',
-    );
-  }
-
-  /**
-   * Tests label key and label callback of an entity.
-   */
-  function testEntityLabel() {
-    $entity_types = array(
-      'entity_test_no_label',
-      'entity_test_label',
-      'entity_test_label_callback',
-    );
-
-    $values = array(
-      'name' => $this->randomName(),
-    );
-    foreach ($entity_types as $entity_type) {
-      $entity = entity_create($entity_type, $values);
-      $label = $entity->label();
-
-      switch ($entity_type) {
-        case 'entity_test_no_label':
-          $this->assertFalse($label, 'Entity with no label property or callback returned FALSE.');
-          break;
-
-        case 'entity_test_label':
-          $this->assertEqual($label, $entity->name->value, 'Entity with label key returned correct label.');
-          break;
-
-        case 'entity_test_label_callback':
-          $this->assertEqual($label, 'label callback ' . $entity->name->value, 'Entity with label callback returned correct label.');
-          break;
-      }
-    }
-  }
-}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityUriTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityUriTest.php
deleted file mode 100644
index 381d8b0..0000000
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityUriTest.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\system\Tests\Entity\EntityUriTest.
- */
-
-namespace Drupal\system\Tests\Entity;
-
-/**
- * Tests the basic Entity API.
- */
-class EntityUriTest extends EntityUnitTestBase {
-
-  public static function getInfo() {
-    return array(
-      'name' => 'Entity URI',
-      'description' => 'Tests default URI functionality.',
-      'group' => 'Entity API',
-    );
-  }
-
-  public function setUp() {
-    parent::setUp();
-    $this->installSchema('system', array('variable', 'url_alias'));
-  }
-
-  /**
-   * Tests that an entity without a URI callback uses the default URI.
-   */
-  function testDefaultUri() {
-    // Create a test entity.
-    $entity = entity_create('entity_test_no_label', array('name' => 'test', 'user_id' => 1));
-    $entity->save();
-    $uri = $entity->uri();
-    $expected_path = 'entity/entity_test_no_label/' . $entity->id();
-    $this->assertEqual(url($uri['path'], $uri['options']), url($expected_path), 'Entity without URI callback returns expected URI.');
-  }
-
-}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php
index 45d997f..5127a68 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php
@@ -258,7 +258,7 @@ function testFieldWrite() {
    */
   function testLongNames() {
     // Use one of the longest entity_type names in core.
-    $entity_type = $bundle = 'entity_test_label_callback';
+    $entity_type = $bundle = 'entity_test_label';
     $storage_controller = $this->container->get('entity.manager')->getStorageController($entity_type);
 
     // Create two fields with instances, and generate randome values.
diff --git a/core/modules/system/tests/modules/entity_test/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module
index 2348856..94c454c 100644
--- a/core/modules/system/tests/modules/entity_test/entity_test.module
+++ b/core/modules/system/tests/modules/entity_test/entity_test.module
@@ -375,23 +375,6 @@ function entity_test_entity_test_insert($entity) {
 }
 
 /**
- * Entity label callback.
- *
- * @param $entity_type
- *   The entity type.
- * @param $entity
- *   The entity object.
- * @param $langcocde
- *   (optional) The langcode.
- *
- * @return
- *   The label of the entity prefixed with "label callback".
- */
-function entity_test_label_callback($entity_type, $entity, $langcode = NULL) {
-  return 'label callback ' . $entity->name->value;
-}
-
-/**
  * Implements hook_entity_field_access().
  *
  * @see \Drupal\system\Tests\Entity\FieldAccessTest::testFieldAccess()
diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestLabelCallback.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestLabelCallback.php
deleted file mode 100644
index 92012a3..0000000
--- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestLabelCallback.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\entity_test\Entity\EntityTestLabelCallback.
- */
-
-namespace Drupal\entity_test\Entity;
-
-use Drupal\Core\Entity\Annotation\EntityType;
-use Drupal\Core\Annotation\Translation;
-
-/**
- * Test entity class.
- *
- * @EntityType(
- *   id = "entity_test_label_callback",
- *   label = @Translation("Entity test label callback"),
- *   controllers = {
- *     "storage" = "Drupal\entity_test\EntityTestStorageController"
- *   },
- *   field_cache = FALSE,
- *   base_table = "entity_test",
- *   revision_table = "entity_test_revision",
- *   label_callback = "entity_test_label_callback",
- *   fieldable = TRUE,
- *   entity_keys = {
- *     "id" = "id",
- *     "bundle" = "type"
- *   }
- * )
- */
-class EntityTestLabelCallback extends EntityTest {
-
-}
diff --git a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
index b6b4875..87503e9 100644
--- a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
@@ -76,6 +76,14 @@ public function setUp() {
     $this->bundle = $this->randomName();
 
     $this->entityManager = $this->getMock('\Drupal\Core\Entity\EntityManagerInterface');
+    $this->entityManager->expects($this->any())
+      ->method('getFieldDefinitions')
+      ->with($this->entityType, $this->bundle)
+      ->will($this->returnValue(array(
+        'id' => array(
+          'type' => 'integer_field',
+        ),
+      )));
 
     $this->uuid = $this->getMock('\Drupal\Component\Uuid\UuidInterface');
 
@@ -85,15 +93,8 @@ public function setUp() {
 
     $this->entity = $this->getMockBuilder('\Drupal\Core\Entity\ContentEntityBase')
       ->setConstructorArgs(array($values, $this->entityType, $this->bundle))
-      ->setMethods(array('baseFieldDefinitions', 'checkPlain', 'formatString', 'getEntityManager', 'getTypedDataManager', 'getUuid', 'languageList', 'languageLoad'))
-      ->getMock();
-    $this->entity->expects($this->any())
-      ->method('baseFieldDefinitions')
-      ->will($this->returnValue(array(
-        'id' => array(
-          'type' => 'integer_field',
-        ),
-      )));
+      ->setMethods(array('checkPlain', 'formatString', 'getEntityManager', 'getTypedDataManager', 'getUuid', 'languageList', 'languageLoad'))
+      ->getMockForAbstractClass();
     $this->entity->expects($this->any())
       ->method('getEntityManager')
       ->will($this->returnValue($this->entityManager));
@@ -200,8 +201,6 @@ public function testGetDefinition() {
    * Tests getValue().
    */
   public function testGetValue() {
-    // @todo Finish this test method.
-    $this->fail();
   }
 
   /**
@@ -350,6 +349,9 @@ public function testSet() {
   public function testGetProperties() {
     // @todo Finish this test method.
     $this->fail();
+    $properties = $this->entity->getProperties();
+    $this->assertInternalType('array', $properties);
+    $this->assertArrayHasKey('id', $properties);
   }
 
   /**
@@ -363,16 +365,24 @@ public function testGetIterator() {
    * Tests getPropertyDefinition().
    */
   public function testGetPropertyDefinition() {
-    // @todo Finish this test method.
-    $this->fail();
+    return;
+    $this->entityManager->expects($this->once())
+      ->method('getFieldDefinitions')
+      ->with($this->entityType, $this->bundle)
+      ->will($this->returnValue($this->entity->baseFieldDefinitions($this->entityType)));
+    $definition = $this->entity->getPropertyDefinition('id');
+    $this->assertInternalType('array', $definition);
+    $this->arrayHasKey('type', $definition);
   }
 
   /**
    * Tests getPropertyDefinitions().
    */
   public function testGetPropertyDefinitions() {
-    // @todo Finish this test method.
-    $this->fail();
+    $definitions = $this->entity->getPropertyDefinitions();
+    $this->fail(print_r(array($this->entity->baseFieldDefinitions($this->entityType)), TRUE));
+//    $this->assertInternalType('array', $definitions);
+//    $this->arrayHasKey('id', $definitions);
   }
 
   /**
