fillApiKeys(); $this->laravelPayku = new LaravelPayku(); } /** @test */ function it_can_handle_when_it_has_register_status() { $response = $this->registerResponse(); $this->laravelPayku->handleAPIResponse($response); $this->assertEquals('register', $this->laravelPayku->status); } /** @test */ function it_can_handle_when_it_has_pending_status() { $response = $this->pendingResponse(); $this->laravelPayku->handleAPIResponse($response); $this->assertEquals('pending', $this->laravelPayku->status); } /** @test */ function it_can_handle_when_it_has_failed_status() { $response = $this->failedResponse(); $this->laravelPayku->handleAPIResponse($response); $this->assertEquals('failed', $this->laravelPayku->status); } /** @test */ function it_can_handle_when_it_has_success_status() { $response = $this->successResponse(); $this->laravelPayku->handleAPIResponse($response); $this->assertEquals('success', $this->laravelPayku->status); } /** @test */ function it_can_handle_an_error_when_it_has_an_invalid_status() { $this->expectException(\Exception::class); $response = $this->invalidResponse(); $this->laravelPayku->handleAPIResponse($response); } }