mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 06:37:33 -05:00 
			
		
		
		
	* style cs * Style CS * Throw Record not found exception if invalid primary key hash is provided * Improve error handling * Create abstract implementation for designs * working on custom designs * Add Design Model * invoice services * Download Invoice by Invitation
		
			
				
	
	
		
			59 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace Tests\Integration;
 | 
						|
 | 
						|
use App\Events\Invoice\InvoiceWasCreated;
 | 
						|
use App\Events\Invoice\InvoiceWasUpdated;
 | 
						|
use App\Events\Payment\PaymentWasCreated;
 | 
						|
use App\Jobs\Invoice\MarkInvoicePaid;
 | 
						|
use App\Jobs\Util\UploadFile;
 | 
						|
use App\Models\Account;
 | 
						|
use App\Models\Activity;
 | 
						|
use App\Models\Company;
 | 
						|
use App\Models\CompanyLedger;
 | 
						|
use App\Models\Invoice;
 | 
						|
use App\Models\Payment;
 | 
						|
use App\Models\User;
 | 
						|
use Illuminate\Foundation\Testing\Concerns\InteractsWithDatabase;
 | 
						|
use Illuminate\Foundation\Testing\DatabaseTransactions;
 | 
						|
use Illuminate\Http\UploadedFile;
 | 
						|
use Illuminate\Routing\Middleware\ThrottleRequests;
 | 
						|
use Illuminate\Support\Facades\Log;
 | 
						|
use Illuminate\Support\Facades\Storage;
 | 
						|
use Tests\MockAccountData;
 | 
						|
use Tests\TestCase;
 | 
						|
 | 
						|
/**
 | 
						|
 * @test
 | 
						|
 * @covers  App\Jobs\Util\UploadFile
 | 
						|
 */
 | 
						|
class UploadFileTest extends TestCase
 | 
						|
{
 | 
						|
    use MockAccountData;
 | 
						|
    use DatabaseTransactions;
 | 
						|
 | 
						|
    public function setUp() :void
 | 
						|
    {
 | 
						|
        parent::setUp();
 | 
						|
 | 
						|
        $this->makeTestData();
 | 
						|
 | 
						|
        $this->withoutMiddleware(
 | 
						|
            ThrottleRequests::class
 | 
						|
        );
 | 
						|
    }
 | 
						|
 | 
						|
 | 
						|
    public function testFileUploadWorks()
 | 
						|
    {
 | 
						|
        $image = UploadedFile::fake()->image('avatar.jpg');
 | 
						|
 | 
						|
        $document = UploadFile::dispatchNow(
 | 
						|
            $image, UploadFile::IMAGE, $this->invoice->user, $this->invoice->company, $this->invoice
 | 
						|
        );
 | 
						|
 
 | 
						|
        $this->assertNotNull($document);
 | 
						|
 | 
						|
    }
 | 
						|
}
 |