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

Test factory with unit testing

parent c04b1d23
......@@ -10,12 +10,8 @@ namespace Drupal\typed_entity\Tests;
use Drupal\typed_entity\Exception\TypedEntityException;
use Drupal\typed_entity\TypedEntity\Tests\MockEntityDrupalWrapper;
use Drupal\typed_entity\TypedEntity\Tests\MockEntityWrapperService;
use Drupal\typed_entity\TypedEntity\Tests\TypedEntityModules;
use Drupal\typed_entity\TypedEntity\TypedEntity;
use Drupal\typed_entity\TypedEntity\TypedEntityManager;
use Drupal\typed_entity_example\TypedEntity\Node\Article;
use Drupal\xautoload\Tests\Mock\MockDrupalSystem;
use Drupal\xautoload\Tests\VirtualDrupal\DrupalComponentContainer;
class TypedEntityUnitTestCase extends \DrupalUnitTestCase {
......@@ -84,7 +80,6 @@ class TypedEntityUnitTestCase extends \DrupalUnitTestCase {
// Get the mock entity to be loaded.
$entity = $wrapper_service->wrap('node', NULL)->value();
$typed_article = TypedEntityManager::create('node', $entity);
$this->assertTrue($typed_article instanceof Article);
$this->assertEqual('node', $typed_article->getEntityType());
$this->assertEqual('article', $typed_article->getBundle());
$this->assertEqual($entity, $typed_article->getEntity(), 'Correct entity set');
......
......@@ -7,6 +7,7 @@
namespace Drupal\typed_entity_example\Tests;
use Drupal\typed_entity\TypedEntity\Tests\MockEntityWrapperService;
use Drupal\typed_entity\TypedEntity\TypedEntityManager;
use Drupal\typed_entity_example\TypedEntity\Tests\TypedNodeArticleUnitTest;
......@@ -56,4 +57,53 @@ class TypedEntityExampleUnitTestCase extends \DrupalUnitTestCase {
$this->assertEqual(TypedEntityManager::camelize('1-a>234'), '1A>234');
$this->assertEqual(TypedEntityManager::camelize(''), '');
}
/**
* Test factory.
*/
public function testFactory() {
$wrapper_service = new MockEntityWrapperService();
$wrapper_service->setFixturePath(__DIR__ . '/fixtures/article.inc');
xautoload()
->getServiceContainer()
->set('entity_wrapper', $wrapper_service);
// Get the mock entity to be loaded.
$entity = $wrapper_service->wrap('node', NULL)->value();
$typed_article = TypedEntityManager::create('node', $entity);
$reflection_article = new \ReflectionClass($typed_article);
if ($reflection_article->name == 'Drupal\typed_entity_example\TypedEntity\Node\Article') {
$this->pass('The hook_typed_entity_registry_info is taking precedence.');
}
else {
$this->fail('The hook_typed_entity_registry_info is not taking precedence.');
}
$wrapper_service->setFixturePath(__DIR__ . '/fixtures/page.inc');
// Get the mock entity to be loaded.
$entity = $wrapper_service->wrap('node', NULL)->value();
$typed_page = TypedEntityManager::create('node', $entity);
$reflection_page = new \ReflectionClass($typed_page);
if ($reflection_page->name == 'Drupal\typed_entity_example\TypedEntity\TypedNode') {
$this->pass('The factory is falling back to TypedNode.');
}
else {
$this->fail('The factory is not falling back to TypedNode.');
}
// Test the fallback to TypedEntity.
$wrapper_service->setFixturePath(__DIR__ . '/fixtures/page.inc');
// Get the mock entity to be loaded.
$entity = $wrapper_service->wrap('node', NULL)->value();
$typed_user = TypedEntityManager::create('user', $entity);
$reflection_user = new \ReflectionClass($typed_user);
if ($reflection_user->name == 'Drupal\typed_entity\TypedEntity\TypedEntity') {
$this->pass('The factory is falling back to TypedEntity.');
}
else {
$this->fail('The factory is not falling back to TypedEntity.');
}
}
}
<?php
/**
* @file
* Contains \Drupal\typed_entity_example\Tests\TypedEntityExampleWebTestCase
*/
namespace Drupal\typed_entity_example\Tests;
use Drupal\typed_entity\TypedEntity\TypedEntityManager;
class TypedEntityExampleWebTestCase extends \DrupalWebTestCase {
/**
* Declare test information.
*
* @return array
* The information array.
*/
public static function getInfo() {
return array(
'name' => 'Typed entity example (functional)',
'description' => 'Functional tests for Typed Entity.',
'group' => 'Typed Entity',
);
}
/**
* Set up.
*/
protected function setUp() {
parent::setUp('typed_entity_example');
}
/**
* Test factory.
*/
public function testFactory() {
$article = $this->drupalCreateNode(array(
'type' => 'article',
'title' => 'Test article',
));
$typed_article = TypedEntityManager::create('node', $article);
$reflection_article = new \ReflectionClass($typed_article);
if ($reflection_article->name == 'Drupal\typed_entity_example\TypedEntity\Node\Article') {
$this->pass('The hook_typed_entity_registry_info is taking precedence.');
}
else {
$this->fail('The hook_typed_entity_registry_info is not taking precedence.');
}
// Test the fallback to the TypedNode.
$page = $this->drupalCreateNode(array(
'type' => 'page',
'title' => 'Test article',
));
$typed_page = TypedEntityManager::create('node', $page);
$reflection_page = new \ReflectionClass($typed_page);
if ($reflection_page->name == 'Drupal\typed_entity_example\TypedEntity\TypedNode') {
$this->pass('The factory is falling back to TypedNode.');
}
else {
$this->fail('The factory is not falling back to TypedNode.');
}
// Test the fallback to TypedEntity.
$account = $this->drupalCreateUser();
$typed_user = TypedEntityManager::create('user', $account);
$reflection_user = new \ReflectionClass($typed_user);
if ($reflection_user->name == 'Drupal\typed_entity\TypedEntity\TypedEntity') {
$this->pass('The factory is falling back to TypedEntity.');
}
else {
$this->fail('The factory is not falling back to TypedEntity.');
}
}
}
<?php
$fixture = array(
'bundle' => 'article',
'entity keys' =>
array(
'id' => 'nid',
'revision' => 'vid',
'bundle' => 'type',
'label' => 'title',
'language' => 'language',
),
'entity' => (object) array(
'vid' => '1',
'uid' => '1',
'title' => 'Lorem ipsum dolor sit amet, consetetur sadipscing',
'log' => '',
'status' => '1',
'comment' => '2',
'promote' => '1',
'sticky' => '0',
'nid' => '1',
'type' => 'article',
'language' => 'en',
'created' => '1368005430',
'changed' => '1369320916',
'tnid' => '0',
'translate' => '0',
'revision_timestamp' => '1369320916',
'revision_uid' => '1',
'body' => array(
'und' => array(
array(
'value' => 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.',
'summary' => '',
'format' => 'filtered_html',
'safe_value' => '<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
',
'safe_summary' => '',
),
),
),
'field_tags' => array(
'und' => array(
array(
'tid' => '1',
),
),
),
'field_image' => array(
'und' => array(
array(
'fid' => '1',
'uid' => '1',
'filename' => 'DSCF2211.jpg',
'uri' => 'public://field/image/DSCF2211.jpg',
'filemime' => 'image/jpeg',
'filesize' => '46156',
'status' => '1',
'timestamp' => '1424800819',
'type' => 'image',
'field_file_image_alt_text' => array(),
'field_file_image_title_text' => array(),
'rdf_mapping' => array(),
'metadata' => array(
'height' => 320,
'width' => 180,
),
'alt' => '',
'title' => '',
'width' => '180',
'height' => '320',
),
),
),
'field_facebook_pub' => array(
'und' => array(
array(
'target_id' => '3',
),
),
),
'field_it2' => array(),
'rdf_mapping' => array(
'field_image' => array(
'predicates' => array(
'og:image',
'rdfs:seeAlso',
),
'type' => 'rel',
),
'field_tags' => array(
'predicates' => array(
'dc:subject',
),
'type' => 'rel',
),
'rdftype' => array(
'sioc:Item',
'foaf:Document',
),
'title' => array(
'predicates' =>
array(
'dc:title',
),
),
'created' => array(
'predicates' => array(
'dc:date',
'dc:created',
),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
'changed' => array(
'predicates' => array(
'dc:modified',
),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
'body' => array(
'predicates' => array(
'content:encoded',
),
),
'uid' => array(
'predicates' => array(
'sioc:has_creator',
),
'type' => 'rel',
),
'name' => array(
'predicates' => array(
'foaf:name',
),
),
'comment_count' => array(
'predicates' => array(
'sioc:num_replies',
),
'datatype' => 'xsd:integer',
),
'last_activity' => array(
'predicates' => array(
'sioc:last_activity_date',
),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
),
'cid' => '9',
'last_comment_timestamp' => '1405499171',
'last_comment_name' => '',
'last_comment_uid' => '1',
'comment_count' => '9',
'name' => 'admin',
'picture' => '0',
'data' => 'b:0;',
),
);
<?php
$fixture = array(
'bundle' => 'page',
'entity keys' =>
array(
'id' => 'nid',
'revision' => 'vid',
'bundle' => 'type',
'label' => 'title',
'language' => 'language',
),
'entity' => (object) array(
'vid' => '3',
'uid' => '1',
'title' => 'Video embed',
'log' => '',
'status' => '1',
'comment' => '1',
'promote' => '0',
'sticky' => '0',
'nid' => '3',
'type' => 'page',
'language' => 'en',
'created' => '1391502189',
'changed' => '1391502189',
'tnid' => '0',
'translate' => '0',
'revision_timestamp' => '1391502189',
'revision_uid' => '1',
'body' =>
array(
'und' => array(
array(
'value' => 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.',
'summary' => '',
'format' => 'filtered_html',
'safe_value' => '<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
',
'safe_summary' => '',
),
),
),
'field_video' =>
array(
'und' => array(
array(
'video_url' => 'http://www.youtube.com/watch?v=fSAgFxjFSqY',
'thumbnail_path' => 'public://video_embed_field_thumbnails/youtube/fSAgFxjFSqY.jpg',
'video_data' => 'a:26:{s:5:"xmlns";s:27:"http://www.w3.org/2005/Atom";s:11:"xmlns$media";s:29:"http://search.yahoo.com/mrss/";s:8:"xmlns$gd";s:32:"http://schemas.google.com/g/2005";s:9:"xmlns$gml";s:26:"http://www.opengis.net/gml";s:8:"xmlns$yt";s:37:"http://gdata.youtube.com/schemas/2007";s:12:"xmlns$georss";s:28:"http://www.georss.org/georss";s:7:"gd$etag";s:28:"W/"D0ANRX47eCp7I2A9Wh9SEkQ."";s:2:"id";s:38:"tag:youtube.com,2008:video:fSAgFxjFSqY";s:9:"published";s:24:"2013-06-18T00:25:08.000Z";s:7:"updated";s:24:"2014-02-01T23:03:14.000Z";s:8:"category";a:2:{i:0;a:2:{s:6:"scheme";s:37:"http://schemas.google.com/g/2005#kind";s:4:"term";s:43:"http://gdata.youtube.com/schemas/2007#video";}i:1;a:3:{s:6:"scheme";s:52:"http://gdata.youtube.com/schemas/2007/categories.cat";s:4:"term";s:9:"Education";s:5:"label";s:9:"Education";}}s:5:"title";s:44:"Frontend Workflows with Grunt and Angular JS";s:7:"content";a:2:{s:4:"type";s:29:"application/x-shockwave-flash";s:3:"src";s:73:"http://www.youtube.com/v/fSAgFxjFSqY?version=3&f=videos&app=youtube_gdata";}s:4:"link";a:5:{i:0;a:3:{s:3:"rel";s:9:"alternate";s:4:"type";s:9:"text/html";s:4:"href";s:64:"http://www.youtube.com/watch?v=fSAgFxjFSqY&feature=youtube_gdata";}i:1;a:3:{s:3:"rel";s:51:"http://gdata.youtube.com/schemas/2007#video.related";s:4:"type";s:20:"application/atom+xml";s:4:"href";s:65:"http://gdata.youtube.com/feeds/api/videos/fSAgFxjFSqY/related?v=2";}i:2;a:3:{s:3:"rel";s:44:"http://gdata.youtube.com/schemas/2007#mobile";s:4:"type";s:9:"text/html";s:4:"href";s:42:"http://m.youtube.com/details?v=fSAgFxjFSqY";}i:3;a:3:{s:3:"rel";s:46:"http://gdata.youtube.com/schemas/2007#uploader";s:4:"type";s:20:"application/atom+xml";s:4:"href";s:67:"http://gdata.youtube.com/feeds/api/users/8TXEl4mrSZ4BVOkOJdhXQA?v=2";}i:4;a:3:{s:3:"rel";s:4:"self";s:4:"type";s:20:"application/atom+xml";s:4:"href";s:57:"http://gdata.youtube.com/feeds/api/videos/fSAgFxjFSqY?v=2";}}s:6:"author";a:1:{i:0;a:3:{s:4:"name";s:12:"David Mosher";s:3:"uri";s:52:"http://gdata.youtube.com/feeds/api/users/vidjadavemo";s:9:"yt$userId";s:22:"8TXEl4mrSZ4BVOkOJdhXQA";}}s:16:"yt$accessControl";a:8:{i:0;a:2:{s:6:"action";s:7:"comment";s:10:"permission";s:7:"allowed";}i:1;a:2:{s:6:"action";s:11:"commentVote";s:10:"permission";s:7:"allowed";}i:2;a:2:{s:6:"action";s:12:"videoRespond";s:10:"permission";s:9:"moderated";}i:3;a:2:{s:6:"action";s:4:"rate";s:10:"permission";s:7:"allowed";}i:4;a:2:{s:6:"action";s:5:"embed";s:10:"permission";s:7:"allowed";}i:5;a:2:{s:6:"action";s:4:"list";s:10:"permission";s:7:"allowed";}i:6;a:2:{s:6:"action";s:8:"autoPlay";s:10:"permission";s:7:"allowed";}i:7;a:2:{s:6:"action";s:9:"syndicate";s:10:"permission";s:7:"allowed";}}s:11:"gd$comments";a:1:{s:11:"gd$feedLink";a:3:{s:3:"rel";s:46:"http://gdata.youtube.com/schemas/2007#comments";s:4:"href";s:66:"http://gdata.youtube.com/feeds/api/videos/fSAgFxjFSqY/comments?v=2";s:9:"countHint";i:25;}}s:12:"georss$where";a:1:{s:9:"gml$Point";a:1:{s:7:"gml$pos";s:19:"52.13437 -106.64766";}}s:5:"yt$hd";a:0:{}s:11:"media$group";a:14:{s:14:"media$category";a:1:{i:0;s:9:"Education";}s:13:"media$content";a:3:{i:0;a:7:{s:3:"url";s:73:"http://www.youtube.com/v/fSAgFxjFSqY?version=3&f=videos&app=youtube_gdata";s:4:"type";s:29:"application/x-shockwave-flash";s:6:"medium";s:5:"video";s:9:"isDefault";s:4:"true";s:10:"expression";s:4:"full";s:8:"duration";i:3757;s:9:"yt$format";i:5;}i:1;a:6:{s:3:"url";s:102:"rtsp://r4---sn-cg07luel.c.youtube.com/CiILENy73wIaGQmmSsUYFyAgfRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp";s:4:"type";s:10:"video/3gpp";s:6:"medium";s:5:"video";s:10:"expression";s:4:"full";s:8:"duration";i:3757;s:9:"yt$format";i:1;}i:2;a:6:{s:3:"url";s:102:"rtsp://r4---sn-cg07luel.c.youtube.com/CiILENy73wIaGQmmSsUYFyAgfRMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp";s:4:"type";s:10:"video/3gpp";s:6:"medium";s:5:"video";s:10:"expression";s:4:"full";s:8:"duration";i:3757;s:9:"yt$format";i:6;}}s:12:"media$credit";a:1:{i:0;s:11:"vidjadavemo";}s:17:"media$description";s:675:"A screencast that shows front-end developers how they can craft workflows with Grunt JS, along with some specific workflow improvements when working with Angular JS.
This is part 4 of a screencast series:
Part 1: "Intro to Angular JS" http://www.youtube.com/watch?v=8ILQOFAgaXE
Part 2: "End to End with Angular JS" http://www.youtube.com/watch?v=hqAyiqUs93c
Part 3: "Security with Angular JS" http://www.youtube.com/watch?v=18ifoT-Id54
Part 5: "Testing Strategies for Angular JS" http://www.youtube.com/watch?v=UYVcY9EJcRs
Resources:
Github Source: https://github.com/davemo/frontend-workflows-with-grunt-and-angularjs
Resource Bundle: http://bitly.com/bundles/dmosher/7";s:14:"media$keywords";a:0:{}s:13:"media$license";s:2:"cc";s:12:"media$player";a:1:{s:3:"url";s:71:"http://www.youtube.com/watch?v=fSAgFxjFSqY&feature=youtube_gdata_player";}s:15:"media$thumbnail";a:7:{i:0;a:5:{s:3:"url";s:46:"http://i1.ytimg.com/vi/fSAgFxjFSqY/default.jpg";s:6:"height";i:90;s:5:"width";i:120;s:4:"time";s:12:"00:31:18.500";s:7:"yt$name";s:7:"default";}i:1;a:4:{s:3:"url";s:48:"http://i1.ytimg.com/vi/fSAgFxjFSqY/mqdefault.jpg";s:6:"height";i:180;s:5:"width";i:320;s:7:"yt$name";s:9:"mqdefault";}i:2;a:4:{s:3:"url";s:48:"http://i1.ytimg.com/vi/fSAgFxjFSqY/hqdefault.jpg";s:6:"height";i:360;s:5:"width";i:480;s:7:"yt$name";s:9:"hqdefault";}i:3;a:4:{s:3:"url";s:48:"http://i1.ytimg.com/vi/fSAgFxjFSqY/sddefault.jpg";s:6:"height";i:480;s:5:"width";i:640;s:7:"yt$name";s:9:"sddefault";}i:4;a:5:{s:3:"url";s:40:"http://i1.ytimg.com/vi/fSAgFxjFSqY/1.jpg";s:6:"height";i:90;s:5:"width";i:120;s:4:"time";s:12:"00:15:39.250";s:7:"yt$name";s:5:"start";}i:5;a:5:{s:3:"url";s:40:"http://i1.ytimg.com/vi/fSAgFxjFSqY/2.jpg";s:6:"height";i:90;s:5:"width";i:120;s:4:"time";s:12:"00:31:18.500";s:7:"yt$name";s:6:"middle";}i:6;a:5:{s:3:"url";s:40:"http://i1.ytimg.com/vi/fSAgFxjFSqY/3.jpg";s:6:"height";i:90;s:5:"width";i:120;s:4:"time";s:12:"00:46:57.750";s:7:"yt$name";s:3:"end";}}s:11:"media$title";s:44:"Frontend Workflows with Grunt and Angular JS";s:14:"yt$aspectRatio";s:10:"widescreen";s:11:"yt$duration";a:1:{s:7:"seconds";s:4:"3757";}s:11:"yt$uploaded";s:24:"2013-06-18T00:25:08.000Z";s:13:"yt$uploaderId";s:24:"UC8TXEl4mrSZ4BVOkOJdhXQA";s:10:"yt$videoid";s:11:"fSAgFxjFSqY";}s:9:"gd$rating";a:5:{s:7:"average";d:5;s:3:"max";i:5;s:3:"min";i:1;s:9:"numRaters";i:143;s:3:"rel";s:40:"http://schemas.google.com/g/2005#overall";}s:11:"yt$recorded";s:10:"2013-06-17";s:13:"yt$statistics";a:2:{s:13:"favoriteCount";s:1:"0";s:9:"viewCount";s:5:"13967";}s:9:"yt$rating";a:2:{s:11:"numDislikes";s:1:"0";s:8:"numLikes";s:3:"143";}s:5:"terms";a:1:{i:0;s:9:"Education";}s:7:"handler";s:7:"youtube";}',
'embed_code' => NULL,
'description' => 'sed diam nonumy',
),
),
),
'rdf_mapping' => array(
'rdftype' => array(
'foaf:Document',
),
'title' => array(
'predicates' => array(
'dc:title',
),
),
'created' => array(
'predicates' => array(
'dc:date',
1 => 'dc:created',
),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
'changed' => array(
'predicates' => array(
'dc:modified',
),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
'body' => array(
'predicates' => array(
'content:encoded',
),
),
'uid' => array(
'predicates' => array(
'sioc:has_creator',
),
'type' => 'rel',
),
'name' => array(
'predicates' => array(
'foaf:name',
),
),
'comment_count' => array(
'predicates' => array(
'sioc:num_replies',
),
'datatype' => 'xsd:integer',
),
'last_activity' => array(
'predicates' => array(
'sioc:last_activity_date',
),
'datatype' => 'xsd:dateTime',
'callback' => 'date_iso8601',
),
),
'cid' => '0',
'last_comment_timestamp' => '1391502189',
'last_comment_name' => NULL,
'last_comment_uid' => '1',
'comment_count' => '0',
'name' => 'admin',
'picture' => '0',
'data' => 'b:0;',
),
);
<?php
$fixture = array(
'bundle' => 'user',
'entity keys' => array(
'id' => 'uid',
'revision' => '',
'bundle' => '',
),
'entity' => (object) array(
'uid' => '1',
'name' => 'admin',
'pass' => '$S$DKHuKBpoLMv8gFfAhD8krXvxRQUt3WbFkS7L3S72rXArVs2sEDDp',
'mail' => 'admin@example.org',
'theme' => '',
'signature' => '',
'signature_format' => 'filtered_html',
'created' => '1367961694',
'access' => '1427100351',
'login' => '1426940306',
'status' => '1',
'timezone' => 'Europe/Berlin',
'language' => '',
'picture' => NULL,
'init' => 'admin@example.org',
'data' => FALSE,
'roles' => array(
2 => 'authenticated user',
3 => 'administrator',
),
'rdf_mapping' => array(
'rdftype' => array(
'sioc:UserAccount',
),
'name' => array(
'predicates' => array(
'foaf:name',
),
),
'homepage' => array(
'predicates' => array(
'foaf:page',
),
'type' => 'rel',
),
),
),
);
......@@ -48,6 +48,7 @@ class MockEntityWrapperService implements MockEntityWrapperServiceInterface {
*/
public function setFixturePath($fixturePath) {
$this->fixturePath = $fixturePath;
$this->fixture = NULL;
}
/**
......
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