mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 00:04:24 +00:00
Update tests so repositories are not called. Saves on DB calls, speeds up tests.
This commit is contained in:
@@ -44,12 +44,22 @@ use FireflyIII\Support\Import\Routine\Bunq\StageImportDataHandler;
|
||||
use Mockery;
|
||||
use Preferences;
|
||||
use Tests\TestCase;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class StageImportDataHandlerTest
|
||||
*/
|
||||
class StageImportDataHandlerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Support\Import\Routine\Bunq\StageImportDataHandler
|
||||
*/
|
||||
|
@@ -44,12 +44,22 @@ use Mockery;
|
||||
use Preferences;
|
||||
use Tests\Object\FakeApiContext;
|
||||
use Tests\TestCase;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class StageNewHandlerTest
|
||||
*/
|
||||
class StageNewHandlerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Support\Import\Routine\Bunq\StageNewHandler
|
||||
*/
|
||||
|
@@ -29,12 +29,22 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Support\Import\Routine\File\AssetAccountMapper;
|
||||
use Illuminate\Support\Collection;
|
||||
use Tests\TestCase;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class AssetAccountMapperTest
|
||||
*/
|
||||
class AssetAccountMapperTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Should return with the given $default account and not the $bad one.
|
||||
*
|
||||
|
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace Tests\Unit\Support\Import\Routine\File;
|
||||
|
||||
|
||||
use Log;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\ImportJob;
|
||||
use FireflyIII\Support\Import\Routine\File\CSVProcessor;
|
||||
@@ -41,6 +42,14 @@ use Tests\TestCase;
|
||||
*/
|
||||
class CSVProcessorTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
/**
|
||||
* @covers \FireflyIII\Support\Import\Routine\File\CSVProcessor
|
||||
*/
|
||||
|
@@ -28,12 +28,22 @@ use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||
use FireflyIII\Support\Import\Routine\File\CurrencyMapper;
|
||||
use Tests\TestCase;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class CurrencyMapperTest
|
||||
*/
|
||||
class CurrencyMapperTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Support\Import\Routine\File\CurrencyMapper
|
||||
*/
|
||||
|
@@ -35,6 +35,7 @@ use FireflyIII\Support\Import\Routine\File\ImportableConverter;
|
||||
use FireflyIII\Support\Import\Routine\File\OpposingAccountMapper;
|
||||
use Mockery;
|
||||
use Tests\TestCase;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* todo test foreign currency
|
||||
@@ -46,6 +47,15 @@ use Tests\TestCase;
|
||||
*/
|
||||
class ImportableConverterTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Basic test. Should match a withdrawal. Amount is negative.
|
||||
*
|
||||
|
@@ -28,12 +28,22 @@ use FireflyIII\Support\Import\Placeholder\ColumnValue;
|
||||
use FireflyIII\Support\Import\Placeholder\ImportTransaction;
|
||||
use FireflyIII\Support\Import\Routine\File\ImportableCreator;
|
||||
use Tests\TestCase;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class ImportableCreatorTest
|
||||
*/
|
||||
class ImportableCreatorTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Support\Import\Routine\File\ImportableCreator
|
||||
*/
|
||||
|
@@ -32,12 +32,22 @@ use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
|
||||
use FireflyIII\Support\Import\Routine\File\LineReader;
|
||||
use Illuminate\Support\Collection;
|
||||
use Tests\TestCase;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class LineReaderTest
|
||||
*/
|
||||
class LineReaderTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Support\Import\Routine\File\LineReader
|
||||
*/
|
||||
|
@@ -35,12 +35,22 @@ use FireflyIII\Support\Import\Routine\File\MappedValuesValidator;
|
||||
use Illuminate\Support\Collection;
|
||||
use stdClass;
|
||||
use Tests\TestCase;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class MappedValuesValidatorTest
|
||||
*/
|
||||
class MappedValuesValidatorTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Support\Import\Routine\File\MappedValuesValidator
|
||||
*/
|
||||
|
@@ -28,12 +28,21 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\ImportJob;
|
||||
use FireflyIII\Support\Import\Routine\File\MappingConverger;
|
||||
use Tests\TestCase;
|
||||
|
||||
use Log;
|
||||
/**
|
||||
* Class MappingConvergerTest
|
||||
*/
|
||||
class MappingConvergerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Support\Import\Routine\File\MappingConverger
|
||||
*/
|
||||
|
@@ -29,12 +29,22 @@ use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Support\Import\Routine\File\OpposingAccountMapper;
|
||||
use Tests\TestCase;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class OpposingAccountMapperTest
|
||||
*/
|
||||
class OpposingAccountMapperTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Should return account with given ID (which is of correct type).
|
||||
|
@@ -38,12 +38,22 @@ use FireflyIII\Support\Import\Routine\Spectre\StageAuthenticatedHandler;
|
||||
use Mockery;
|
||||
use Preferences;
|
||||
use Tests\TestCase;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class StageAuthenticatedHandlerTest
|
||||
*/
|
||||
class StageAuthenticatedHandlerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Already have logins in configuration.
|
||||
*
|
||||
|
@@ -36,12 +36,21 @@ use FireflyIII\Support\Import\Routine\File\OpposingAccountMapper;
|
||||
use FireflyIII\Support\Import\Routine\Spectre\StageImportDataHandler;
|
||||
use Mockery;
|
||||
use Tests\TestCase;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class StageImportDataHandlerTest
|
||||
*/
|
||||
class StageImportDataHandlerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
/**
|
||||
* @covers \FireflyIII\Support\Import\Routine\Spectre\StageImportDataHandler
|
||||
*/
|
||||
|
@@ -39,13 +39,21 @@ use FireflyIII\Support\Import\Routine\Spectre\StageNewHandler;
|
||||
use Mockery;
|
||||
use Preferences;
|
||||
use Tests\TestCase;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
* Class StageNewHandlerTest
|
||||
*/
|
||||
class StageNewHandlerTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
Log::info(sprintf('Now in %s.', \get_class($this)));
|
||||
}
|
||||
// todo run() with zero logins and an existing customer (must be retrieved from Spectre).
|
||||
// todo run() with one login and an existing customer (must be retrieved from Spectre).
|
||||
|
||||
|
Reference in New Issue
Block a user