@@ -90,28 +90,28 @@ public function testAddDBConnection01() {
9090 ]);
9191
9292 $ this ->assertEquals (0 , $ this ->getExitCode ());
93- $ this ->assertEquals ([
94- " What would you like to add? \n" ,
95- " 0: New database connection. \n" ,
96- " 1 : New SMTP connection. \n" ,
97- " 2 : New website language . \n" ,
98- " 3: Quit. <-- \n" ,
99- " Select database type: \n" ,
100- " 0: mysql \n" ,
101- " 1: mssql \n" ,
102- " Database host: Enter = '127.0.0.1' \n" ,
103- " Port number : Enter = '3306 ' \n" ,
104- " Username: \n" ,
105- " Password : \n" ,
106- " Database name : \n" ,
107- " Give your connection a friendly name: Enter = ' $ connName ' \n" ,
108- " Trying to connect to the database... \n" ,
109- " Trying with 'localhost' ... \n" ,
110- " Error: Unable to connect to the database. \n" ,
111- "Error: Unable to connect to database: 1045 - Access denied for user 'root'@'127.0.0.1' (using password: YES) \n" ,
112- " Would you like to store connection information anyway?(y/N) \n" ,
113- " Success: Connection information was stored in application configuration. \n"
114- ] , $ output );
93+ $ output = $ this ->getOutput ();
94+
95+ $ this -> assertEquals ( " What would you like to add? \n" , $ output [ 0 ]);
96+ $ this -> assertEquals ( " 0 : New database connection. \n" , $ output [ 1 ]);
97+ $ this -> assertEquals ( " 1 : New SMTP connection . \n" , $ output [ 2 ]);
98+ $ this -> assertEquals ( " 2: New website language. \n" , $ output [ 3 ]);
99+ $ this -> assertEquals ( " 3: Quit. <-- \n" , $ output [ 4 ]);
100+ $ this -> assertEquals ( " Select database type: \n" , $ output [ 5 ]);
101+ $ this -> assertEquals ( " 0: mysql \n" , $ output [ 6 ]);
102+ $ this -> assertEquals ( " 1: mssql \n" , $ output [ 7 ]);
103+ $ this -> assertEquals ( " Database host : Enter = '127.0.0.1 ' \n" , $ output [ 8 ]);
104+ $ this -> assertEquals ( " Port number: Enter = '3306' \n" , $ output [ 9 ]);
105+ $ this -> assertEquals ( " Username : \n" , $ output [ 10 ]);
106+ $ this -> assertEquals ( " Password : \n" , $ output [ 11 ]);
107+ $ this -> assertEquals ( " Database name: \n" , $ output [ 12 ]);
108+ $ this -> assertEquals ( " Give your connection a friendly name: Enter = ' $ connName ' \n" , $ output [ 13 ]);
109+ $ this -> assertEquals ( " Trying to connect to the database ... \n" , $ output [ 14 ]);
110+ $ this -> assertEquals ( " Trying with 'localhost'... \n" , $ output [ 15 ]);
111+ $ this -> assertEquals ( "Error: Unable to connect to the database. \n" , $ output [ 16 ]);
112+ $ this -> assertStringContainsString ( " Error: Unable to connect to database: 1045 - Access denied for user " , $ output [ 17 ]);
113+ $ this -> assertEquals ( " Would you like to store connection information anyway?(y/N) \n", $ output [ 18 ]);
114+ $ this -> assertEquals ( " Success: Connection information was stored in application configuration. \n" , $ output[ 19 ] );
115115 }
116116 /**
117117 * @test
@@ -136,27 +136,27 @@ public function testAddDBConnection02() {
136136 ]);
137137
138138 $ this ->assertEquals (0 , $ this ->getExitCode ());
139- $ this ->assertEquals ([
140- " What would you like to add? \n" ,
141- " 0: New database connection. \n" ,
142- " 1 : New SMTP connection. \n" ,
143- " 2 : New website language . \n" ,
144- " 3: Quit. <-- \n" ,
145- " Select database type: \n" ,
146- " 0: mysql \n" ,
147- " 1: mssql \n" ,
148- " Database host: Enter = '127.0.0.1' \n" ,
149- " Port number : Enter = '3306 ' \n" ,
150- " Username: \n" ,
151- " Password : \n" ,
152- " Database name : \n" ,
153- " Give your connection a friendly name: Enter = ' $ connName ' \n" ,
154- " Trying to connect to the database... \n" ,
155- " Trying with 'localhost' ... \n" ,
156- " Error: Unable to connect to the database. \n" ,
157- "Error: Unable to connect to database: 1045 - Access denied for user 'root'@'127.0.0.1' (using password: YES) \n" ,
158- " Would you like to store connection information anyway?(y/N) \n" ,
159- ] , $ output );
139+ $ output = $ this ->getOutput ();
140+
141+ $ this -> assertEquals ( " What would you like to add? \n" , $ output [ 0 ]);
142+ $ this -> assertEquals ( " 0 : New database connection. \n" , $ output [ 1 ]);
143+ $ this -> assertEquals ( " 1 : New SMTP connection . \n" , $ output [ 2 ]);
144+ $ this -> assertEquals ( " 2: New website language. \n" , $ output [ 3 ]);
145+ $ this -> assertEquals ( " 3: Quit. <-- \n" , $ output [ 4 ]);
146+ $ this -> assertEquals ( " Select database type: \n" , $ output [ 5 ]);
147+ $ this -> assertEquals ( " 0: mysql \n" , $ output [ 6 ]);
148+ $ this -> assertEquals ( " 1: mssql \n" , $ output [ 7 ]);
149+ $ this -> assertEquals ( " Database host : Enter = '127.0.0.1 ' \n" , $ output [ 8 ]);
150+ $ this -> assertEquals ( " Port number: Enter = '3306' \n" , $ output [ 9 ]);
151+ $ this -> assertEquals ( " Username : \n" , $ output [ 10 ]);
152+ $ this -> assertEquals ( " Password : \n" , $ output [ 11 ]);
153+ $ this -> assertEquals ( " Database name: \n" , $ output [ 12 ]);
154+ $ this -> assertEquals ( " Give your connection a friendly name: Enter = ' $ connName ' \n" , $ output [ 13 ]);
155+ $ this -> assertEquals ( " Trying to connect to the database ... \n" , $ output [ 14 ]);
156+ $ this -> assertEquals ( " Trying with 'localhost'... \n" , $ output [ 15 ]);
157+ $ this -> assertEquals ( "Error: Unable to connect to the database. \n" , $ output [ 16 ]);
158+ $ this -> assertStringContainsString ( " Error: Unable to connect to database: 1045 - Access denied for user " , $ output [ 17 ]);
159+ $ this -> assertEquals ( " Would you like to store connection information anyway?(y/N) \n" , $ output[ 18 ] );
160160 }
161161
162162 /**
0 commit comments