diff -u b/core/modules/system/src/Tests/Update/UpdateNodeTypeTest.php b/core/modules/system/src/Tests/Update/UpdateNodeTypeTest.php --- b/core/modules/system/src/Tests/Update/UpdateNodeTypeTest.php +++ b/core/modules/system/src/Tests/Update/UpdateNodeTypeTest.php @@ -32,11 +32,10 @@ // Confirm that the current article view modes don't have the // authored on / by base fields configuration. foreach (['teaser', 'default'] as $view_mode) { - $config = $this->config('core.entity_view_display.node.article.' . $view_mode)->get('data'); - $this->assertFalse(isset($config['content']['created']), t('The authored on (created) base field does not exist in the article !view_mode view mode.', array('!view_mode' => $view_mode))); - $this->assertFalse(isset($config['content']['uid']), t('The authored by (uid) base field does not exist in the article !view_mode view mode.', array('!view_mode' => $view_mode))); + $config = $this->config('core.entity_view_display.node.article.' . $view_mode)->get('content'); + $this->assertFalse(isset($config['created']), t('The authored on (created) base field does not exist in the article @view_mode view mode.', array('@view_mode' => $view_mode))); + $this->assertFalse(isset($config['uid']), t('The authored by (uid) base field does not exist in the article @view_mode view mode.', array('@view_mode' => $view_mode))); } - // Second, let's confirm that the page node type doesn't display the // authored by / on information. $page_type = NodeType::load('page'); @@ -47,28 +46,29 @@ foreach (['teaser', 'default'] as $view_mode) { - $config = $this->config('core.entity_view_display.node.page.' . $view_mode)->get('data'); - $this->assertFalse(isset($config['content']['created']), t('The authored on (created) base field does not exist in the page !view_mode view mode.', array('!view_mode' => $view_mode))); - $this->assertFalse(isset($config['content']['uid']), t('The authored by (uid) base field does not exist in the page !view_mode view mode.', array('!view_mode' => $view_mode))); + $config = $this->config('core.entity_view_display.node.page.' . $view_mode)->get('content'); + $this->assertFalse(isset($config['created']), t('The authored on (created) base field does not exist in the page @view_mode view mode.', array('@view_mode' => $view_mode))); + $this->assertFalse(isset($config['uid']), t('The authored by (uid) base field does not exist in the page @view_mode view mode.', array('@view_mode' => $view_mode))); } - $this->runUpdates(); // Confirm that the updates added the authored on / by base fields to the // view mode configuration. foreach (['teaser', 'default'] as $view_mode) { - $config = $this->config('core.entity_view_display.node.article.' . $view_mode)->get('data'); - $this->assertTrue(isset($config['content']['created']), t('The authored on (created) base field exists in the article !view_mode view mode.', array('!view_mode' => $view_mode))); - $this->assertTrue(isset($config['content']['uid']), t('The authored by (uid) base field exists in the article !view_mode view mode.', array('!view_mode' => $view_mode))); - $this->assertEqual($config['content']['created']['region'], 'content', t('The authored on (created) base field appears in the content region of the article !view_mode view mode.', array('!view_mode' => $view_mode))); - $this->assertEqual($config['content']['uid']['region'], 'content', t('The authored by (uid) base field appears in the content region of the article !view_mode view mode.', array('!view_mode' => $view_mode))); + $config = $this->config('core.entity_view_display.node.article.' . $view_mode)->get('content'); + $this->assertTrue(isset($config['created']), t('The authored on (created) base field exists in the article @view_mode view mode.', array('@view_mode' => $view_mode))); + $this->assertTrue(isset($config['uid']), t('The authored by (uid) base field exists in the article @view_mode view mode.', array('@view_mode' => $view_mode))); + $this->assertEqual($config['created']['region'], 'content', t('The authored on (created) base field appears in the content region of the article @view_mode view mode.', array('@view_mode' => $view_mode))); + $this->assertEqual($config['uid']['region'], 'content', t('The authored by (uid) base field appears in the content region of the article @view_mode view mode.', array('@view_mode' => $view_mode))); } // Confirm that the updates added the authored on / by base fields to the // view mode configuration. foreach (['teaser', 'default'] as $view_mode) { - $config = $this->config('core.entity_view_display.node.page.' . $view_mode)->get('data'); - $this->assertTrue(isset($config['content']['created']), t('The authored on (created) base field exists in the page !view_mode view mode.', array('!view_mode' => $view_mode))); - $this->assertTrue(isset($config['content']['uid']), t('The authored by (uid) base field exists in the page !view_mode view mode.', array('!view_mode' => $view_mode))); - $this->assertTrue($config['hidden']['created'], t('The authored on (created) base field is hidden in the page !view_mode view mode.', array('!view_mode' => $view_mode))); - $this->assertTrue($config['hidden']['uid'], t('The authored by (uid) base field is hidden in the page !view_mode view mode.', array('!view_mode' => $view_mode))); + $config = $this->config('core.entity_view_display.node.page.' . $view_mode)->get('content'); + $hidden = $this->config('core.entity_view_display.node.page.' . $view_mode)->get('hidden'); + $this->assertTrue(isset($config['created']), t('The authored on (created) base field exists in the page @view_mode view mode.', array('@view_mode' => $view_mode))); + $this->assertTrue(isset($config['uid']), t('The authored by (uid) base field exists in the page @view_mode view mode.', array('@view_mode' => $view_mode))); + $this->assertTrue($hidden['created'], t('The authored on (created) base field is hidden in the page @view_mode view mode.', array('@view_mode' => $view_mode))); + $this->assertTrue($hidden['uid'], t('The authored by (uid) base field is hidden in the page @view_mode view mode.', array('@view_mode' => $view_mode))); } } + }