X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fuser%2Ftests%2Fsrc%2FFunctional%2FViews%2FUserDataTest.php;fp=web%2Fcore%2Fmodules%2Fuser%2Ftests%2Fsrc%2FFunctional%2FViews%2FUserDataTest.php;h=d15e6f368dde538946b2c869dd9e20578ca4d295;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/core/modules/user/tests/src/Functional/Views/UserDataTest.php b/web/core/modules/user/tests/src/Functional/Views/UserDataTest.php new file mode 100644 index 000000000..d15e6f368 --- /dev/null +++ b/web/core/modules/user/tests/src/Functional/Views/UserDataTest.php @@ -0,0 +1,50 @@ +userData = $this->container->get('user.data'); + $random_value = $this->randomMachineName(); + $this->userData->set('views_test_config', $this->users[0]->id(), 'test_value_name', $random_value); + + $view = Views::getView('test_user_data'); + $this->executeView($view); + + $output = $view->field['data']->render($view->result[0]); + $this->assertEqual($output, $random_value, 'A valid user data got rendered.'); + + $view->field['data']->options['data_name'] = $this->randomMachineName(); + $output = $view->field['data']->render($view->result[0]); + $this->assertFalse($output, 'An invalid configuration does not return anything'); + + } + +}