Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-extension / spec / Drupal / DrupalExtension / Context / RawDrupalContextSpec.php
1 <?php
2
3 namespace spec\Drupal\DrupalExtension\Context;
4
5 use PhpSpec\ObjectBehavior;
6 use Prophecy\Argument;
7
8 use Behat\Testwork\Hook\HookDispatcher;
9 use Behat\Testwork\Hook\HookRepository;
10
11 use Drupal\DrupalDriverManager;
12
13 class RawDrupalContextSpec extends ObjectBehavior
14 {
15     function it_should_be_drupal_aware()
16     {
17         $this->shouldHaveType('Drupal\DrupalExtension\Context\DrupalAwareInterface');
18     }
19
20     function it_can_set_and_get_drupal_manager(DrupalDriverManager $drupal)
21     {
22         $this->setDrupal($drupal);
23         $this->getDrupal()->shouldBeAnInstanceOf('Drupal\DrupalDriverManager');
24     }
25
26     function it_can_set_and_get_drupal_parameters()
27     {
28         $parameters = array(
29             'one' => '1',
30             'two' => '2',
31         );
32         $this->setDrupalParameters($parameters);
33         $this->getDrupalParameter('one')->shouldReturn('1');
34         $this->getDrupalParameter('two')->shouldReturn('2');
35     }
36
37     function it_can_manage_text_values()
38     {
39         $parameters = array(
40             'text' => array(
41                 'login' => 'Log in',
42             ),
43         );
44         $this->setDrupalParameters($parameters);
45         $this->getDrupalText('login')->shouldReturn('Log in');
46         $this->shouldThrow('Exception')->duringGetDrupalText('No such string');
47     }
48
49     function it_can_get_the_current_drupal_driver(DrupalDriverManager $drupal)
50     {
51         $this->setDrupal($drupal);
52         $this->getDriver();
53     }
54
55 }