1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- //  PhoneAuthTest.swift
17- //  SwiftApiTests
1816
1917import  FirebaseAuth
2018import  Foundation
2119import  XCTest
2220
2321class  PhoneAuthTests :  TestsBase  { 
24-   let  kPhoneNumber   =  " +19999999999  " 
22+   let  phoneNumber   =  " +12345678910  " 
2523  // This test verification code is specified for the given test phone number in the developer
2624  // console.
27-   let  kVerificationCode   =  " 777777 " 
25+   let  verificationCode   =  " 123456 " 
2826
2927  func  testSignInWithPhoneNumber( )  throws  { 
3028    Auth . auth ( ) . settings? . isAppVerificationDisabledForTesting =  true  // toAdd
@@ -33,7 +31,7 @@ class PhoneAuthTests: TestsBase {
3331
3432    // PhoneAuthProvider used to initiate the Verification process and obtain a verificationID.
3533    PhoneAuthProvider . provider ( ) 
36-       . verifyPhoneNumber ( kPhoneNumber ,  uiDelegate:  nil )  {  verificationID,  error in 
34+       . verifyPhoneNumber ( phoneNumber ,  uiDelegate:  nil )  {  verificationID,  error in 
3735        if  let  error { 
3836          XCTAssertNil ( error,  " Verification error should be nil " ) 
3937          XCTAssertNotNil ( verificationID,  " Verification ID should not be nil " ) 
@@ -42,17 +40,17 @@ class PhoneAuthTests: TestsBase {
4240        // Create a credential using the test verification code.
4341        let  credential  =  PhoneAuthProvider . provider ( ) . credential ( 
4442          withVerificationID:  verificationID ??  " " , 
45-           verificationCode:  self . kVerificationCode 
43+           verificationCode:  self . verificationCode 
4644        ) 
47-         // signs  in using the credential and verifies that the user is signed in correctly by
45+         // Signs  in using the credential and verifies that the user is signed in correctly by
4846        // checking auth.currentUser.
4947        auth. signIn ( with:  credential)  {  authResult,  error in 
5048          if  let  error { 
5149            XCTAssertNil ( error,  " Sign in error should be nil " ) 
5250            XCTAssertNotNil ( authResult,  " AuthResult should not be nil " ) 
5351            XCTAssertEqual ( 
5452              auth. currentUser? . phoneNumber, 
55-               self . kPhoneNumber , 
53+               self . phoneNumber , 
5654              " Phone number does not match " 
5755            ) 
5856          } 
@@ -61,6 +59,5 @@ class PhoneAuthTests: TestsBase {
6159      } 
6260
6361    waitForExpectations ( timeout:  TestsBase . kExpectationsTimeout) 
64-     // deleteCurrentUser()
6562  } 
6663} 
0 commit comments