7
7
*
8
8
* For the full copyright and license information, please view the LICENSE
9
9
* file that was distributed with this source code.
10
+ *
10
11
*/
11
12
12
13
namespace spec \PHPCR \Shell \Config ;
13
14
14
- use PhpSpec \ObjectBehavior ;
15
- use Prophecy \Argument ;
16
15
use PHPCR \Shell \Config \ConfigManager ;
17
16
use PHPCR \Shell \Config \Profile ;
17
+ use PhpSpec \ObjectBehavior ;
18
+ use Prophecy \Argument ;
18
19
use Symfony \Component \Filesystem \Filesystem ;
19
20
20
21
class ProfileLoaderSpec extends ObjectBehavior
21
22
{
22
23
public function let (
23
24
ConfigManager $ configManager ,
24
25
Filesystem $ filesystem
25
- )
26
- {
26
+ ) {
27
27
$ configManager ->getConfigDir ()->willReturn (__DIR__ );
28
28
$ this ->beConstructedWith ($ configManager , $ filesystem );
29
29
}
@@ -35,49 +35,47 @@ public function it_is_initializable()
35
35
36
36
public function it_should_list_profile_names ()
37
37
{
38
- $ this ->getProfileNames ()->shouldReturn (array (
39
- 'one ' , 'two '
40
- ) );
38
+ $ this ->getProfileNames ()->shouldReturn ([
39
+ 'one ' , 'two ' ,
40
+ ] );
41
41
}
42
42
43
43
public function it_should_load_data_into_a_given_profile (
44
44
Profile $ profile ,
45
45
Filesystem $ filesystem
46
- )
47
- {
46
+ ) {
48
47
$ profile ->get ('phpcr ' , 'workspace ' )->willReturn ('default ' );
49
48
$ profile ->getName ()->willReturn ('one ' );
50
- $ profile ->set ('transport ' , array (
51
- 'name ' => 'foobar ' ,
49
+ $ profile ->set ('transport ' , [
50
+ 'name ' => 'foobar ' ,
52
51
'bar_foo ' => 'barfoo ' ,
53
52
'foo_bar ' => 'foobar ' ,
54
- ) )->shouldBeCalled ();
55
- $ profile ->set ('phpcr ' , array (
56
- 'username ' => 'username ' ,
57
- 'password ' => 'password ' ,
53
+ ] )->shouldBeCalled ();
54
+ $ profile ->set ('phpcr ' , [
55
+ 'username ' => 'username ' ,
56
+ 'password ' => 'password ' ,
58
57
'workspace ' => 'default ' ,
59
- ) )->shouldBeCalled ();
58
+ ] )->shouldBeCalled ();
60
59
61
60
$ this ->loadProfile ($ profile );
62
61
}
63
62
64
63
public function it_should_save_a_given_profile (
65
64
Profile $ profile ,
66
65
Filesystem $ filesystem
67
- )
68
- {
66
+ ) {
69
67
$ profile ->getName ()->willReturn ('newprofile ' );
70
- $ profile ->toArray ()->willReturn (array (
71
- 'transport ' => array (
72
- 'name ' => 'test_transport ' ,
68
+ $ profile ->toArray ()->willReturn ([
69
+ 'transport ' => [
70
+ 'name ' => 'test_transport ' ,
73
71
'option1 ' => 'value1 ' ,
74
- ) ,
75
- 'phpcr ' => array (
72
+ ] ,
73
+ 'phpcr ' => [
76
74
'username ' => 'daniel ' ,
77
75
'password ' => 'leech ' ,
78
- ) ,
79
- ) );
80
- $ filesystem ->dumpFile (Argument::type ('string ' ), <<<EOT
76
+ ] ,
77
+ ] );
78
+ $ filesystem ->dumpFile (Argument::type ('string ' ), <<<' EOT'
81
79
transport:
82
80
name: test_transport
83
81
option1: value1
0 commit comments