|
76 | 76 | ->withAnyArgs() |
77 | 77 | ->andReturn(null); |
78 | 78 |
|
79 | | - // Mock the Config array access |
| 79 | + // Mock the Config array access with comprehensive key handling |
80 | 80 | Config::shouldReceive('offsetGet') |
| 81 | + ->withAnyArgs() |
81 | 82 | ->andReturnUsing(function ($key) { |
82 | | - if ($key === 'logging.default') return 'stack'; |
| 83 | + if ($key === 'netopia.signature') return TestHelper::getTestSignature(); |
| 84 | + if ($key === 'netopia.public_key_path') return TestHelper::getTestPublicKeyPath(); |
| 85 | + if ($key === 'netopia.private_key_path') return TestHelper::getTestPrivateKeyPath(); |
| 86 | + if ($key === 'netopia.live_mode') return false; |
| 87 | + if ($key === 'netopia.default_currency') return 'RON'; |
| 88 | + if ($key === 'app.name') return 'Laravel Netopia Test'; |
| 89 | + if ($key === 'app.debug') return true; |
| 90 | + if ($key === 'app.url') return 'http://localhost'; |
83 | 91 | if ($key === 'app.asset_url') return null; |
| 92 | + if ($key === 'logging.default') return 'stack'; |
| 93 | + if ($key === 'logging.channels.stack') return ['driver' => 'stack', 'channels' => ['single']]; |
| 94 | + if ($key === 'logging.channels.single') return ['driver' => 'single', 'path' => storage_path('logs/laravel.log')]; |
| 95 | + if ($key === 'logging.channels.deprecations') return ['driver' => 'null']; |
84 | 96 | return null; |
85 | 97 | }); |
| 98 | + |
| 99 | + // Mock other array access methods |
| 100 | + Config::shouldReceive('offsetExists') |
| 101 | + ->withAnyArgs() |
| 102 | + ->andReturn(true); |
| 103 | + |
| 104 | + Config::shouldReceive('offsetSet') |
| 105 | + ->withAnyArgs() |
| 106 | + ->andReturnNull(); |
| 107 | + |
| 108 | + Config::shouldReceive('offsetUnset') |
| 109 | + ->withAnyArgs() |
| 110 | + ->andReturnNull(); |
86 | 111 |
|
87 | 112 | // Define test routes that the controller will redirect to |
88 | 113 | Route::get('/payment/success', function () { |
|
0 commit comments