@@ -117,10 +117,10 @@ protected function get_contents( $url, $method = 'GET', $params = array() )
117117 */
118118 protected function login ( $ user , $ password )
119119 {
120- $ this ->getSession ( ' default ' )->visit ( $ this ->locatePath ( '/wp-login.php ' ) );
120+ $ this ->getSession ()->visit ( $ this ->locatePath ( '/wp-login.php ' ) );
121121 $ this ->wait_the_element ( "#loginform " );
122122
123- $ element = $ this ->getSession ( ' default ' )->getPage ();
123+ $ element = $ this ->getSession ()->getPage ();
124124 $ element ->fillField ( "user_login " , $ user );
125125 $ element ->fillField ( "user_pass " , $ password );
126126
@@ -154,7 +154,7 @@ protected function login( $user, $password )
154154 */
155155 protected function is_current_url ( $ url )
156156 {
157- $ current_url = $ this ->getSession ( ' default ' )->getCurrentUrl ();
157+ $ current_url = $ this ->getSession ()->getCurrentUrl ();
158158
159159 if ( $ url === substr ( $ current_url , 0 - strlen ( $ url ) ) ) {
160160 return true ;
@@ -176,15 +176,15 @@ protected function logout()
176176 return ; // user isn't login.
177177 }
178178
179- $ page = $ this ->getSession ( ' default ' )->getPage ();
179+ $ page = $ this ->getSession ()->getPage ();
180180 $ logout = $ page ->find ( "css " , "#wp-admin-bar-logout a " );
181181
182182 if ( ! empty ( $ logout ) ) {
183- $ this ->getSession ( ' default ' )->visit ( $ this ->locatePath ( $ logout ->getAttribute ( "href " ) ) );
183+ $ this ->getSession ()->visit ( $ this ->locatePath ( $ logout ->getAttribute ( "href " ) ) );
184184
185185 for ( $ i = 0 ; $ i < $ this ->timeout ; $ i ++ ) {
186186 try {
187- $ url = $ this ->getSession ( ' default ' )->getCurrentUrl ();
187+ $ url = $ this ->getSession ()->getCurrentUrl ();
188188 if ( strpos ( $ url , "loggedout=true " ) ) {
189189 return true ;
190190 }
@@ -207,7 +207,7 @@ protected function logout()
207207 */
208208 protected function is_logged_in ()
209209 {
210- $ page = $ this ->getSession ( ' default ' )->getPage ();
210+ $ page = $ this ->getSession ()->getPage ();
211211 if ( $ page ->find ( "css " , ".logged-in " ) ) {
212212 return true ;
213213 } elseif ( $ page ->find ( "css " , ".wp-admin " ) ) {
@@ -226,7 +226,7 @@ protected function is_logged_in()
226226 */
227227 protected function wait_the_element ( $ selector )
228228 {
229- $ page = $ this ->getSession ( ' default ' )->getPage ();
229+ $ page = $ this ->getSession ()->getPage ();
230230 $ element = $ page ->find ( 'css ' , $ selector );
231231
232232 for ( $ i = 0 ; $ i < $ this ->timeout ; $ i ++ ) {
@@ -257,7 +257,7 @@ protected function get_plugins()
257257 throw new \Exception ( "You are not logged in " );
258258 }
259259
260- $ session = $ this ->getSession ( ' default ' );
260+ $ session = $ this ->getSession ();
261261 $ session ->visit ( $ this ->locatePath ( $ this ->get_admin_url () . '/plugins.php ' ) );
262262 $ page = $ session ->getPage ();
263263 $ e = $ page ->findAll ( 'css ' , "#the-list tr " );
@@ -295,8 +295,8 @@ protected function get_current_theme()
295295 throw new \Exception ( "You are not logged in " );
296296 }
297297
298- $ this ->getSession ( ' default ' )->visit ( $ this ->locatePath ( $ this ->get_admin_url () . '/themes.php ' ) );
299- $ page = $ this ->getSession ( ' default ' )->getPage ();
298+ $ this ->getSession ()->visit ( $ this ->locatePath ( $ this ->get_admin_url () . '/themes.php ' ) );
299+ $ page = $ this ->getSession ()->getPage ();
300300 $ e = $ page ->find ( 'css ' , ".theme.active " );
301301 if ( $ e ) {
302302 $ theme = $ e ->getAttribute ( "data-slug " );
@@ -316,8 +316,8 @@ protected function get_current_theme()
316316 */
317317 protected function get_wp_version ()
318318 {
319- $ this ->getSession ( ' default ' )->visit ( $ this ->locatePath ( '/ ' ) );
320- $ page = $ this ->getSession ( ' default ' )->getPage ();
319+ $ this ->getSession ()->visit ( $ this ->locatePath ( '/ ' ) );
320+ $ page = $ this ->getSession ()->getPage ();
321321 $ meta = $ page ->find ( 'css ' , "meta[name=generator] " );
322322 if ( $ meta ) {
323323 $ version = $ meta ->getAttribute ( "content " );
0 commit comments