|
289 | 289 | ->with($this->tempDir, 1) |
290 | 290 | ->andReturn(['created' => 1, 'updated' => 0, 'deleted' => 0, 'skipped' => 0, 'errors' => []]); |
291 | 291 |
|
292 | | - $this->artisan('bookstack:push', ['path' => $this->tempDir, '--book' => 1, '--force' => true]) |
| 292 | + $this->artisan('bookstack:push', ['path' => $this->tempDir, '--book' => '1', '--force' => true]) |
293 | 293 | ->expectsOutputToContain('Sync completed') |
294 | 294 | ->assertSuccessful(); |
295 | 295 | }); |
|
309 | 309 | $this->bookstack->shouldReceive('pushToBook') |
310 | 310 | ->andReturn(['created' => 1, 'updated' => 0, 'deleted' => 0, 'skipped' => 0, 'errors' => []]); |
311 | 311 |
|
312 | | - $this->artisan('bookstack:push', ['path' => $this->tempDir, '--book' => 1, '--force' => true, '--dry-run' => true]) |
| 312 | + $this->artisan('bookstack:push', ['path' => $this->tempDir, '--book' => '1', '--force' => true, '--dry-run' => true]) |
313 | 313 | ->expectsOutputToContain('DRY RUN') |
314 | 314 | ->assertSuccessful(); |
315 | 315 | }); |
|
325 | 325 | $this->bookstack->shouldReceive('pushToBook') |
326 | 326 | ->andReturn(['created' => 0, 'updated' => 0, 'deleted' => 0, 'skipped' => 0, 'errors' => ['Error 1', 'Error 2']]); |
327 | 327 |
|
328 | | - $this->artisan('bookstack:push', ['path' => $this->tempDir, '--book' => 1, '--force' => true]) |
| 328 | + $this->artisan('bookstack:push', ['path' => $this->tempDir, '--book' => '1', '--force' => true]) |
329 | 329 | ->expectsOutputToContain('Errors') |
330 | 330 | ->assertFailed(); |
331 | 331 | }); |
|
334 | 334 | $this->bookstack->shouldReceive('book') |
335 | 335 | ->andThrow(BookStackException::notFound('book', 999)); |
336 | 336 |
|
337 | | - $this->artisan('bookstack:push', ['path' => $this->tempDir, '--book' => 999, '--force' => true]) |
| 337 | + $this->artisan('bookstack:push', ['path' => $this->tempDir, '--book' => '999', '--force' => true]) |
338 | 338 | ->expectsOutputToContain('Push failed') |
339 | 339 | ->assertFailed(); |
340 | 340 | }); |
|
343 | 343 | $this->bookstack->shouldReceive('book') |
344 | 344 | ->andReturn(new BookDTO(id: 1, name: 'Test Book', slug: 'test-book')); |
345 | 345 |
|
346 | | - $this->artisan('bookstack:push', ['path' => $this->tempDir, '--book' => 1]) |
| 346 | + $this->artisan('bookstack:push', ['path' => $this->tempDir, '--book' => '1']) |
347 | 347 | ->expectsConfirmation('Do you want to proceed?', 'no') |
348 | 348 | ->expectsOutputToContain('cancelled') |
349 | 349 | ->assertSuccessful(); |
|
368 | 368 | it('fails without path', function () { |
369 | 369 | config()->set('bookstack-sync.markdown.source_path', null); |
370 | 370 |
|
371 | | - $this->artisan('bookstack:pull', ['--book' => 1]) |
| 371 | + $this->artisan('bookstack:pull', ['--book' => '1']) |
372 | 372 | ->expectsOutputToContain('No path specified') |
373 | 373 | ->assertFailed(); |
374 | 374 | }); |
|
386 | 386 | ->with(1, $this->tempDir) |
387 | 387 | ->andReturn(['created' => 2, 'updated' => 0, 'skipped' => 0, 'errors' => []]); |
388 | 388 |
|
389 | | - $this->artisan('bookstack:pull', ['--book' => 1, '--path' => $this->tempDir, '--force' => true]) |
| 389 | + $this->artisan('bookstack:pull', ['--book' => '1', '--path' => $this->tempDir, '--force' => true]) |
390 | 390 | ->expectsOutputToContain('Pull completed') |
391 | 391 | ->assertSuccessful(); |
392 | 392 | }); |
|
404 | 404 | $this->bookstack->shouldReceive('pullFromBook') |
405 | 405 | ->andReturn(['created' => 1, 'updated' => 0, 'skipped' => 0, 'errors' => []]); |
406 | 406 |
|
407 | | - $this->artisan('bookstack:pull', ['--book' => 1, '--path' => $this->tempDir, '--force' => true, '--dry-run' => true]) |
| 407 | + $this->artisan('bookstack:pull', ['--book' => '1', '--path' => $this->tempDir, '--force' => true, '--dry-run' => true]) |
408 | 408 | ->expectsOutputToContain('DRY RUN') |
409 | 409 | ->assertSuccessful(); |
410 | 410 | }); |
|
420 | 420 | $this->bookstack->shouldReceive('pullFromBook') |
421 | 421 | ->andReturn(['created' => 0, 'updated' => 0, 'skipped' => 0, 'errors' => ['Pull error']]); |
422 | 422 |
|
423 | | - $this->artisan('bookstack:pull', ['--book' => 1, '--path' => $this->tempDir, '--force' => true]) |
| 423 | + $this->artisan('bookstack:pull', ['--book' => '1', '--path' => $this->tempDir, '--force' => true]) |
424 | 424 | ->expectsOutputToContain('Errors') |
425 | 425 | ->assertFailed(); |
426 | 426 | }); |
|
429 | 429 | $this->bookstack->shouldReceive('book') |
430 | 430 | ->andThrow(BookStackException::notFound('book', 999)); |
431 | 431 |
|
432 | | - $this->artisan('bookstack:pull', ['--book' => 999, '--path' => $this->tempDir, '--force' => true]) |
| 432 | + $this->artisan('bookstack:pull', ['--book' => '999', '--path' => $this->tempDir, '--force' => true]) |
433 | 433 | ->expectsOutputToContain('Pull failed') |
434 | 434 | ->assertFailed(); |
435 | 435 | }); |
|
438 | 438 | $this->bookstack->shouldReceive('book') |
439 | 439 | ->andReturn(new BookDTO(id: 1, name: 'Test Book', slug: 'test-book')); |
440 | 440 |
|
441 | | - $this->artisan('bookstack:pull', ['--book' => 1, '--path' => $this->tempDir]) |
| 441 | + $this->artisan('bookstack:pull', ['--book' => '1', '--path' => $this->tempDir]) |
442 | 442 | ->expectsConfirmation('Do you want to proceed?', 'no') |
443 | 443 | ->expectsOutputToContain('cancelled') |
444 | 444 | ->assertSuccessful(); |
|
0 commit comments