@@ -72,58 +72,34 @@ public function testShouldAllowAddConfigurationAsDsn()
72
72
$ this ->assertEquals (['dsn ' => 'dsn:// ' ], $ config );
73
73
}
74
74
75
- public function testThrowIfNeitherDsnNorAliasConfiguredOnCreateConnectionFactory ()
75
+ public function testShouldSetNullTransportByDefault ()
76
76
{
77
77
$ transport = new DefaultTransportFactory ();
78
78
$ tb = new TreeBuilder ();
79
79
$ rootNode = $ tb ->root ('foo ' );
80
80
81
81
$ transport ->addConfiguration ($ rootNode );
82
82
$ processor = new Processor ();
83
- $ config = $ processor ->process ($ tb ->buildTree (), [[]]);
84
83
85
- // guard
86
- $ this ->assertEquals ([], $ config );
84
+ $ config = $ processor -> process ( $ tb -> buildTree (), [ null ]);
85
+ $ this ->assertEquals ([' dsn ' => ' null:// ' ], $ config );
87
86
88
- $ this ->expectException (\LogicException::class);
89
- $ this ->expectExceptionMessage ('Either dsn or alias option must be set ' );
90
- $ transport ->createConnectionFactory (new ContainerBuilder (), $ config );
91
- }
92
-
93
- public function testThrowIfNeitherDsnNorAliasConfiguredOnCreateContext ()
94
- {
95
- $ transport = new DefaultTransportFactory ();
96
- $ tb = new TreeBuilder ();
97
- $ rootNode = $ tb ->root ('foo ' );
98
-
99
- $ transport ->addConfiguration ($ rootNode );
100
- $ processor = new Processor ();
101
- $ config = $ processor ->process ($ tb ->buildTree (), [[]]);
102
-
103
- // guard
104
- $ this ->assertEquals ([], $ config );
105
-
106
- $ this ->expectException (\LogicException::class);
107
- $ this ->expectExceptionMessage ('Either dsn or alias option must be set ' );
108
- $ transport ->createContext (new ContainerBuilder (), $ config );
87
+ $ config = $ processor ->process ($ tb ->buildTree (), ['' ]);
88
+ $ this ->assertEquals (['dsn ' => 'null:// ' ], $ config );
109
89
}
110
90
111
- public function testThrowIfNeitherDsnNorAliasConfiguredOnCreateDriver ()
91
+ public function testThrowIfNeitherDsnNorAliasConfigured ()
112
92
{
113
93
$ transport = new DefaultTransportFactory ();
114
94
$ tb = new TreeBuilder ();
115
95
$ rootNode = $ tb ->root ('foo ' );
116
96
117
97
$ transport ->addConfiguration ($ rootNode );
118
98
$ processor = new Processor ();
119
- $ config = $ processor ->process ($ tb ->buildTree (), [[]]);
120
-
121
- // guard
122
- $ this ->assertEquals ([], $ config );
123
99
124
100
$ this ->expectException (\LogicException::class);
125
101
$ this ->expectExceptionMessage ('Either dsn or alias option must be set ' );
126
- $ transport -> createDriver ( new ContainerBuilder (), $ config );
102
+ $ processor -> process ( $ tb -> buildTree (), [[]] );
127
103
}
128
104
129
105
public function testShouldCreateConnectionFactoryFromAlias ()
0 commit comments