Updated tests.

This commit is contained in:
James Cole 2016-01-23 08:48:36 +01:00
parent 0d5efb8d27
commit f83bc3c8b3
7 changed files with 277 additions and 136 deletions

View File

@ -13,6 +13,7 @@ use Illuminate\Http\Request;
use Input;
use Log;
use Preferences;
use Request as RequestFacade;
use Session;
use View;
@ -57,8 +58,9 @@ class CsvController extends Controller
public function columnRoles()
{
$fields = ['csv-file', 'csv-date-format', 'csv-has-headers', 'csv-import-account', 'csv-delimiter'];
$fields = ['csv-file', 'csv-date-format', 'csv-has-headers', 'csv-import-account', 'csv-specifix', 'csv-delimiter'];
if (!$this->wizard->sessionHasValues($fields)) {
Log::error('Could not recover upload.');
Session::flash('warning', 'Could not recover upload.');
return redirect(route('csv.index'));
@ -122,13 +124,18 @@ class CsvController extends Controller
}
$result = json_encode($data, JSON_PRETTY_PRINT);
$name = 'csv-configuration-' . date('Y-m-d') . '.json';
$name = sprintf('"%s"', addcslashes('csv-configuration-' . date('Y-m-d') . '.json', '"\\'));
header('Content-disposition: attachment; filename=' . $name);
header('Content-type: application/json');
echo $result;
RequestFacade::header('Content-disposition: attachment; filename=' . $name);
RequestFacade::header('Content-Type: application/json');
RequestFacade::header('Content-Description: File Transfer');
RequestFacade::header('Connection: Keep-Alive');
RequestFacade::header('Expires: 0');
RequestFacade::header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
RequestFacade::header('Pragma: public');
RequestFacade::header('Content-Length: ' . strlen($result));
return '';
return $result;
}
/**
@ -136,6 +143,13 @@ class CsvController extends Controller
*/
public function downloadConfigPage()
{
$fields = ['csv-date-format', 'csv-has-headers', 'csv-delimiter'];
if (!$this->wizard->sessionHasValues($fields)) {
Session::flash('warning', 'Could not recover upload.');
return redirect(route('csv.index'));
}
$subTitle = trans('firefly.csv_download_config_title');
return view('csv.download-config', compact('subTitle'));
@ -266,6 +280,8 @@ class CsvController extends Controller
try {
$options = $this->wizard->showOptions($this->data->getMap());
} catch (FireflyException $e) {
Log::error($e->getMessage());
return view('error', ['message' => $e->getMessage()]);
}

View File

@ -38,14 +38,12 @@ then
# run it!
echo "Now running $firstFile"
phpunit --verbose $firstFile
exit $?
fi
if [ -f "$secondFile" ]
then
# run it!
echo "Now running $secondFile"
phpunit --verbose $secondFile
exit $?
fi

View File

@ -18,14 +18,6 @@
<directory suffix=".php">app/</directory>
</whitelist>
</filter>
<!--
Code coverage has never been slower.
-->
<!--
<logging>
<log type="coverage-clover" target="./storage/build/clover.xml" charset="UTF-8" />
</logging>
-->
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>

2
pu.sh
View File

@ -43,14 +43,12 @@ then
# run it!
echo "Now running $firstFile"
phpunit --verbose $firstFile
exit $?
fi
if [ -f "$secondFile" ]
then
# run it!
echo "Now running $secondFile"
phpunit --verbose $secondFile
exit $?
fi

View File

@ -1,65 +1,65 @@
NL11XOLA6707795988,NL10PTJB2963674082,"Duis fringilla libero eget quam pharetra, non gravida ex fermentum.",20160122,18.17,cash,household
NL11XOLA6707795988,NL43PCCF0336398891,"Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat.",20160122,29.47,bike,household
NL11XOLA6707795988,NL43FVSK2306325839,"Morbi quis mauris nec tortor egestas blandit.",20160122,45.42,car,household
NL11XOLA6707795988,NL35MKIY9736938778,"Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat.",20160122,37.3,dinner,clothes
NL11XOLA6707795988,NL79YXIG5127509172,"Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat.",20160122,12.02,bike,groceries
NL11XOLA6707795988,NL50BBGH8090225241,"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",20160122,19.05,bike,studies
NL11XOLA6707795988,NL69SILM0484853589,"In scelerisque velit eget ante pharetra pretium.",20160122,13.43,gifts,bills
NL11XOLA6707795988,NL48MJPV7247585684,"Morbi quis mauris nec tortor egestas blandit.",20160122,47.31,car,studies
NL11XOLA6707795988,NL41KITW7622223212,"Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem.",20160122,33.57,taxes,clothes
NL11XOLA6707795988,NL27WOWN6072969151,"Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa.",20160122,21.34,cash,groceries
NL11XOLA6707795988,NL29FVTD1470732785,"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",20160122,42.71,bike,holiday
NL11XOLA6707795988,NL45YBAF5167045592,"Morbi quis mauris nec tortor egestas blandit.",20160122,49.72,car,studies
NL11XOLA6707795988,NL04TNIP4218080631,"Aenean dictum sem pellentesque, semper est eget, ultricies magna.",20160122,17.37,food,groceries
NL11XOLA6707795988,NL62WGZO5809991173,"Aenean dictum sem pellentesque, semper est eget, ultricies magna.",20160122,47.58,taxes,clothes
NL11XOLA6707795988,NL08RUWQ3946442994,"Nulla a dui euismod nulla convallis dictum.",20160122,13.6,taxes,holiday
NL11XOLA6707795988,NL35MKIY9736938778,"Nam in purus porta, accumsan felis vitae, bibendum leo.",20160122,45.45,bike,groceries
NL11XOLA6707795988,NL32TPWJ6653031136,"Morbi quis mauris nec tortor egestas blandit.",20160122,13.47,food,studies
NL11XOLA6707795988,NL27WOWN6072969151,"Nulla a dui euismod nulla convallis dictum.",20160122,36.06,car,clothes
NL11XOLA6707795988,NL88GMSX1890703281,"Morbi quis mauris nec tortor egestas blandit.",20160122,17.71,gifts,clothes
NL11XOLA6707795988,NL57XWYZ7311027810,"Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa.",20160122,17.12,taxes,bills
NL11XOLA6707795988,NL53XXRC4353165917,"Vivamus ultrices tortor vel semper lacinia.",20160122,48.13,food,bills
NL11XOLA6707795988,NL71NZET6513049113,"Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem.",20160122,30.21,food,household
NL11XOLA6707795988,NL34WNPM5967636595,"Nunc sed leo scelerisque quam consectetur elementum quis consequat dui.",20160122,23.83,gifts,household
NL11XOLA6707795988,NL92QQAD9910045494,"Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat.",20160122,18.37,food,studies
NL11XOLA6707795988,NL96DQGH5594709053,"Nullam malesuada orci in vulputate imperdiet.",20160122,34.31,car,studies
NL32EMMZ6999206899,NL11XOLA6707795988,"In scelerisque velit eget ante pharetra pretium.",20160122,41.03,"books and such",clothes
NL72JOAK5065057265,NL11XOLA6707795988,"Nullam malesuada orci in vulputate imperdiet.",20160122,34.21,car,groceries
NL40KZVR5107424627,NL11XOLA6707795988,"Vivamus ultrices tortor vel semper lacinia.",20160122,34.9,taxes,clothes
NL78DRZM0805589694,NL11XOLA6707795988,"Morbi quis mauris nec tortor egestas blandit.",20160122,27.86,"books and such",household
NL68TROA2774597773,NL11XOLA6707795988,"Proin eleifend magna et ante cursus laoreet.",20160122,19.62,taxes,"other stuff"
NL46WEXF3324987229,NL11XOLA6707795988,"Suspendisse tempus eros euismod leo consequat, non malesuada arcu pretium.",20160122,34.12,gifts,bills
NL60TTSG7972999589,NL11XOLA6707795988,"Vivamus ultrices tortor vel semper lacinia.",20160122,36.49,dinner,"other stuff"
NL20GJDZ7286831224,NL11XOLA6707795988,"Nullam malesuada orci in vulputate imperdiet.",20160122,36.25,bike,bills
NL70NICN4864639604,NL11XOLA6707795988,"Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat.",20160122,15.29,groceries,groceries
NL66KCKB4009393114,NL11XOLA6707795988,"Aenean dictum sem pellentesque, semper est eget, ultricies magna.",20160122,45.87,taxes,holiday
NL62LELR1702168905,NL11XOLA6707795988,"Duis fringilla libero eget quam pharetra, non gravida ex fermentum.",20160122,31.89,gifts,household
NL79PBCN6122638412,NL11XOLA6707795988,"Nulla a dui euismod nulla convallis dictum.",20160122,35.52,"books and such","other stuff"
NL16FBYT1696665639,NL11XOLA6707795988,"Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa.",20160122,18.96,"books and such",groceries
NL81QKMO3338422717,NL11XOLA6707795988,"Vivamus ultrices tortor vel semper lacinia.",20160122,24.94,taxes,studies
NL63GVZI7651340124,NL11XOLA6707795988,"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",20160122,32.58,cash,"other stuff"
NL17REMH4925281321,NL11XOLA6707795988,"Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem.",20160122,46.01,"books and such",studies
NL54XPIH7528269468,NL11XOLA6707795988,"Vivamus ultrices tortor vel semper lacinia.",20160122,13.43,groceries,household
NL53NOPK8565452735,NL11XOLA6707795988,"Nam in purus porta, accumsan felis vitae, bibendum leo.",20160122,19.77,taxes,holiday
NL62ZZPH8329588521,NL11XOLA6707795988,"Nulla in neque sed velit ultricies placerat.",20160122,43.43,cash,clothes
NL12KOHE7606000581,NL11XOLA6707795988,"In scelerisque velit eget ante pharetra pretium.",20160122,31.07,groceries,clothes
NL37RYLJ9835423733,NL11XOLA6707795988,"Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa.",20160122,39.39,bike,clothes
NL15PQBO6144269770,NL11XOLA6707795988,"Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem.",20160122,20.08,car,groceries
NL27WOWN6072969151,NL11XOLA6707795988,"Vivamus ultrices tortor vel semper lacinia.",20160122,46.78,dinner,"other stuff"
NL60YKHO5522486392,NL11XOLA6707795988,"Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat.",20160122,34.91,cash,holiday
NL61AZND8571986983,NL11XOLA6707795988,"Duis fringilla libero eget quam pharetra, non gravida ex fermentum.",20160122,12.57,groceries,groceries
NL11XOLA6707795988,NL96DZCO4665940223,"Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat.",20160122,22.59,groceries,
NL11XOLA6707795988,NL96DZCO4665940223,"Nullam malesuada orci in vulputate imperdiet.",20160122,36.57,dinner,
NL11XOLA6707795988,NL96DZCO4665940223,"Proin eleifend magna et ante cursus laoreet.",20160122,34.9,food,
NL11XOLA6707795988,NL96DZCO4665940223,"Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem.",20160122,22.87,car,
NL11XOLA6707795988,NL96DZCO4665940223,"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",20160122,32.95,car,
NL11XOLA6707795988,NL96DZCO4665940223,"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",20160122,35.47,bike,
NL11XOLA6707795988,NL96DZCO4665940223,"Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa.",20160122,41.43,taxes,
NL11XOLA6707795988,NL96DZCO4665940223,"Aenean dictum sem pellentesque, semper est eget, ultricies magna.",20160122,30.85,food,
NL11XOLA6707795988,NL96DZCO4665940223,"Suspendisse tempus eros euismod leo consequat, non malesuada arcu pretium.",20160122,29.28,groceries,
NL11XOLA6707795988,NL96DZCO4665940223,"Aenean dictum sem pellentesque, semper est eget, ultricies magna.",20160122,31.86,cash,
NL11XOLA6707795988,NL96DZCO4665940223,"Aenean dictum sem pellentesque, semper est eget, ultricies magna.",20160122,20.22,car,
NL11XOLA6707795988,NL96DZCO4665940223,"Vivamus ultrices tortor vel semper lacinia.",20160122,29.66,cash,
NL11XOLA6707795988,NL96DZCO4665940223,"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",20160122,13.29,taxes,
NL11XOLA6707795988,NL96DZCO4665940223,"Vivamus ultrices tortor vel semper lacinia.",20160122,33.69,gifts,
NL11XOLA6707795988,NL96DZCO4665940223,"Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa.",20160122,34.7,dinner,
NL11XOLA6707795988,NL10TAPT8906262744,"Suspendisse tempus eros euismod leo consequat, non malesuada arcu pretium.",20160123,15.03,gifts,holiday
NL11XOLA6707795988,NL93UPSZ1261542703,"Morbi quis mauris nec tortor egestas blandit.",20160123,47.38,groceries,studies
NL11XOLA6707795988,NL86IHAL3264575116,"Proin eleifend magna et ante cursus laoreet.",20160123,43.73,"books and such",groceries
NL11XOLA6707795988,NL63BKBO9993148806,"In scelerisque velit eget ante pharetra pretium.",20160123,39.21,dinner,holiday
NL11XOLA6707795988,NL22EZVA6611573534,"Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat.",20160123,24.77,taxes,holiday
NL11XOLA6707795988,NL40KZVR5107424627,"Nam in purus porta, accumsan felis vitae, bibendum leo.",20160123,17.19,dinner,clothes
NL11XOLA6707795988,NL29RHEE6437366575,"Suspendisse tempus eros euismod leo consequat, non malesuada arcu pretium.",20160123,43.14,cash,studies
NL11XOLA6707795988,NL63IEPJ7437420074,"Nunc sed leo scelerisque quam consectetur elementum quis consequat dui.",20160123,35.25,gifts,bills
NL11XOLA6707795988,NL62HQWJ8837203470,"Aenean dictum sem pellentesque, semper est eget, ultricies magna.",20160123,42.07,taxes,holiday
NL11XOLA6707795988,NL89FPEA1494900858,"Vivamus ultrices tortor vel semper lacinia.",20160123,25.31,gifts,groceries
NL11XOLA6707795988,NL76MDMU3222445567,"In scelerisque velit eget ante pharetra pretium.",20160123,41.76,cash,clothes
NL11XOLA6707795988,NL07TDQA3309954056,"Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem.",20160123,10.81,food,studies
NL11XOLA6707795988,NL35MKIY9736938778,"Aenean dictum sem pellentesque, semper est eget, ultricies magna.",20160123,46.82,"books and such",bills
NL11XOLA6707795988,NL63IEPJ7437420074,"Nullam malesuada orci in vulputate imperdiet.",20160123,10.3,groceries,studies
NL11XOLA6707795988,NL56DNGY5455310496,"Morbi quis mauris nec tortor egestas blandit.",20160123,22.39,bike,bills
NL11XOLA6707795988,NL17LKFR7594179781,"Vivamus ultrices tortor vel semper lacinia.",20160123,11.45,gifts,clothes
NL11XOLA6707795988,NL76UJQI9524250446,"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",20160123,49.23,bike,studies
NL11XOLA6707795988,NL45YTPP6157249080,"Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem.",20160123,22.6,cash,"other stuff"
NL11XOLA6707795988,NL46TFVH5548690248,"Nam in purus porta, accumsan felis vitae, bibendum leo.",20160123,44.34,bike,holiday
NL11XOLA6707795988,NL79XZWN0846248670,"Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat.",20160123,12.96,car,groceries
NL11XOLA6707795988,NL52MKIO8325583045,"Duis fringilla libero eget quam pharetra, non gravida ex fermentum.",20160123,44.47,taxes,bills
NL11XOLA6707795988,NL47YVJU4419567422,"Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem.",20160123,17.51,car,bills
NL11XOLA6707795988,NL04TNIP4218080631,"Suspendisse tempus eros euismod leo consequat, non malesuada arcu pretium.",20160123,17.36,cash,groceries
NL11XOLA6707795988,NL68SOAC3516744723,"In scelerisque velit eget ante pharetra pretium.",20160123,34.22,taxes,groceries
NL11XOLA6707795988,NL53YVTS7223912863,"Nam in purus porta, accumsan felis vitae, bibendum leo.",20160123,27.9,food,"other stuff"
NL11XOLA6707795988,NL40QRBS9553175317,"Vivamus ultrices tortor vel semper lacinia.",20160123,-10.86,groceries,holiday
NL11XOLA6707795988,NL79XZWN0846248670,"Duis fringilla libero eget quam pharetra, non gravida ex fermentum.",20160123,-19.57,bike,household
NL11XOLA6707795988,NL54TZNZ2922111989,"Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa.",20160123,-12.05,cash,holiday
NL11XOLA6707795988,NL04BAGX3284775110,"Aenean dictum sem pellentesque, semper est eget, ultricies magna.",20160123,-15.98,groceries,bills
NL11XOLA6707795988,NL49LULH7261231215,"Nam in purus porta, accumsan felis vitae, bibendum leo.",20160123,-35.67,food,clothes
NL11XOLA6707795988,NL11YHMI8046080217,"Nunc sed leo scelerisque quam consectetur elementum quis consequat dui.",20160123,-48.94,dinner,clothes
NL11XOLA6707795988,NL89BXNF2470379032,"Aenean dictum sem pellentesque, semper est eget, ultricies magna.",20160123,-33.82,taxes,holiday
NL11XOLA6707795988,NL74SHGG7300113478,"In scelerisque velit eget ante pharetra pretium.",20160123,-17.36,food,"other stuff"
NL11XOLA6707795988,NL48ZPLO1718215436,"Duis fringilla libero eget quam pharetra, non gravida ex fermentum.",20160123,-19.31,food,holiday
NL11XOLA6707795988,NL13BJMO5341591615,"Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa.",20160123,-28.47,groceries,"other stuff"
NL11XOLA6707795988,NL59PKVU0116767154,"Proin eleifend magna et ante cursus laoreet.",20160123,-39.24,taxes,"other stuff"
NL11XOLA6707795988,NL72BQRL1220175315,"Nulla in neque sed velit ultricies placerat.",20160123,-17.53,groceries,bills
NL11XOLA6707795988,NL53QHDG0329036955,"Nulla a dui euismod nulla convallis dictum.",20160123,-39.45,"books and such",holiday
NL11XOLA6707795988,NL29RHEE6437366575,"Lorem ipsum dolor sit amet, consectetur adipiscing elit.",20160123,-23.47,food,studies
NL11XOLA6707795988,NL48BLDJ9721843563,"Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem.",20160123,-16.56,food,"other stuff"
NL11XOLA6707795988,NL48BHXI9733658006,"Nulla in neque sed velit ultricies placerat.",20160123,-21.89,gifts,household
NL11XOLA6707795988,NL33VPSU8067103542,"Duis fringilla libero eget quam pharetra, non gravida ex fermentum.",20160123,-11.71,groceries,clothes
NL11XOLA6707795988,NL62UDLY8957139303,"Nunc sed leo scelerisque quam consectetur elementum quis consequat dui.",20160123,-38.08,gifts,groceries
NL11XOLA6707795988,NL28EDMD2653501341,"Aenean dictum sem pellentesque, semper est eget, ultricies magna.",20160123,-39.57,cash,holiday
NL11XOLA6707795988,NL92QMZD6854625548,"Duis fringilla libero eget quam pharetra, non gravida ex fermentum.",20160123,-48.8,car,groceries
NL11XOLA6707795988,NL37VSLJ0853659915,"Nulla a dui euismod nulla convallis dictum.",20160123,-34.55,bike,household
NL11XOLA6707795988,NL95NQHS4363870109,"Suspendisse tempus eros euismod leo consequat, non malesuada arcu pretium.",20160123,-34.95,dinner,studies
NL11XOLA6707795988,NL81LEJP9477634344,"Vivamus ultrices tortor vel semper lacinia.",20160123,-13.18,dinner,"other stuff"
NL11XOLA6707795988,NL14JYVJ1041891180,"Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem.",20160123,-12.79,groceries,bills
NL11XOLA6707795988,NL57SPBS0788124528,"Nam in purus porta, accumsan felis vitae, bibendum leo.",20160123,-35.53,bike,groceries
NL11XOLA6707795988,NL96DZCO4665940223,"Proin eleifend magna et ante cursus laoreet.",20160123,34.41,groceries,
NL11XOLA6707795988,NL96DZCO4665940223,"Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem.",20160123,35.8,groceries,
NL11XOLA6707795988,NL96DZCO4665940223,"Nam in purus porta, accumsan felis vitae, bibendum leo.",20160123,22.46,car,
NL11XOLA6707795988,NL96DZCO4665940223,"Nam in purus porta, accumsan felis vitae, bibendum leo.",20160123,43.74,bike,
NL11XOLA6707795988,NL96DZCO4665940223,"Aenean dictum sem pellentesque, semper est eget, ultricies magna.",20160123,28.68,dinner,
NL11XOLA6707795988,NL96DZCO4665940223,"Duis fringilla libero eget quam pharetra, non gravida ex fermentum.",20160123,32.36,car,
NL11XOLA6707795988,NL96DZCO4665940223,"Nam in purus porta, accumsan felis vitae, bibendum leo.",20160123,37.76,groceries,
NL11XOLA6707795988,NL96DZCO4665940223,"Nulla in neque sed velit ultricies placerat.",20160123,19.98,"books and such",
NL11XOLA6707795988,NL96DZCO4665940223,"Aenean dictum sem pellentesque, semper est eget, ultricies magna.",20160123,26.57,gifts,
NL11XOLA6707795988,NL96DZCO4665940223,"Morbi quis mauris nec tortor egestas blandit.",20160123,12.09,"books and such",
NL11XOLA6707795988,NL96DZCO4665940223,"Vivamus ultrices tortor vel semper lacinia.",20160123,34.96,dinner,
NL11XOLA6707795988,NL96DZCO4665940223,"Nullam malesuada orci in vulputate imperdiet.",20160123,16.62,food,
NL11XOLA6707795988,NL96DZCO4665940223,"Nulla a dui euismod nulla convallis dictum.",20160123,31.14,car,
NL11XOLA6707795988,NL96DZCO4665940223,"Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat.",20160123,45.1,bike,
NL11XOLA6707795988,NL96DZCO4665940223,"Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat.",20160123,24.92,groceries,

1 NL11XOLA6707795988 NL10PTJB2963674082 NL10TAPT8906262744 Duis fringilla libero eget quam pharetra, non gravida ex fermentum. Suspendisse tempus eros euismod leo consequat, non malesuada arcu pretium. 20160122 20160123 18.17 15.03 cash gifts household holiday
2 NL11XOLA6707795988 NL43PCCF0336398891 NL93UPSZ1261542703 Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat. Morbi quis mauris nec tortor egestas blandit. 20160122 20160123 29.47 47.38 bike groceries household studies
3 NL11XOLA6707795988 NL43FVSK2306325839 NL86IHAL3264575116 Morbi quis mauris nec tortor egestas blandit. Proin eleifend magna et ante cursus laoreet. 20160122 20160123 45.42 43.73 car books and such household groceries
4 NL11XOLA6707795988 NL35MKIY9736938778 NL63BKBO9993148806 Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat. In scelerisque velit eget ante pharetra pretium. 20160122 20160123 37.3 39.21 dinner dinner clothes holiday
5 NL11XOLA6707795988 NL79YXIG5127509172 NL22EZVA6611573534 Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat. Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat. 20160122 20160123 12.02 24.77 bike taxes groceries holiday
6 NL11XOLA6707795988 NL50BBGH8090225241 NL40KZVR5107424627 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam in purus porta, accumsan felis vitae, bibendum leo. 20160122 20160123 19.05 17.19 bike dinner studies clothes
7 NL11XOLA6707795988 NL69SILM0484853589 NL29RHEE6437366575 In scelerisque velit eget ante pharetra pretium. Suspendisse tempus eros euismod leo consequat, non malesuada arcu pretium. 20160122 20160123 13.43 43.14 gifts cash bills studies
8 NL11XOLA6707795988 NL48MJPV7247585684 NL63IEPJ7437420074 Morbi quis mauris nec tortor egestas blandit. Nunc sed leo scelerisque quam consectetur elementum quis consequat dui. 20160122 20160123 47.31 35.25 car gifts studies bills
9 NL11XOLA6707795988 NL41KITW7622223212 NL62HQWJ8837203470 Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem. Aenean dictum sem pellentesque, semper est eget, ultricies magna. 20160122 20160123 33.57 42.07 taxes taxes clothes holiday
10 NL11XOLA6707795988 NL27WOWN6072969151 NL89FPEA1494900858 Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa. Vivamus ultrices tortor vel semper lacinia. 20160122 20160123 21.34 25.31 cash gifts groceries groceries
11 NL11XOLA6707795988 NL29FVTD1470732785 NL76MDMU3222445567 Lorem ipsum dolor sit amet, consectetur adipiscing elit. In scelerisque velit eget ante pharetra pretium. 20160122 20160123 42.71 41.76 bike cash holiday clothes
12 NL11XOLA6707795988 NL45YBAF5167045592 NL07TDQA3309954056 Morbi quis mauris nec tortor egestas blandit. Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem. 20160122 20160123 49.72 10.81 car food studies studies
13 NL11XOLA6707795988 NL04TNIP4218080631 NL35MKIY9736938778 Aenean dictum sem pellentesque, semper est eget, ultricies magna. Aenean dictum sem pellentesque, semper est eget, ultricies magna. 20160122 20160123 17.37 46.82 food books and such groceries bills
14 NL11XOLA6707795988 NL62WGZO5809991173 NL63IEPJ7437420074 Aenean dictum sem pellentesque, semper est eget, ultricies magna. Nullam malesuada orci in vulputate imperdiet. 20160122 20160123 47.58 10.3 taxes groceries clothes studies
15 NL11XOLA6707795988 NL08RUWQ3946442994 NL56DNGY5455310496 Nulla a dui euismod nulla convallis dictum. Morbi quis mauris nec tortor egestas blandit. 20160122 20160123 13.6 22.39 taxes bike holiday bills
16 NL11XOLA6707795988 NL35MKIY9736938778 NL17LKFR7594179781 Nam in purus porta, accumsan felis vitae, bibendum leo. Vivamus ultrices tortor vel semper lacinia. 20160122 20160123 45.45 11.45 bike gifts groceries clothes
17 NL11XOLA6707795988 NL32TPWJ6653031136 NL76UJQI9524250446 Morbi quis mauris nec tortor egestas blandit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. 20160122 20160123 13.47 49.23 food bike studies studies
18 NL11XOLA6707795988 NL27WOWN6072969151 NL45YTPP6157249080 Nulla a dui euismod nulla convallis dictum. Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem. 20160122 20160123 36.06 22.6 car cash clothes other stuff
19 NL11XOLA6707795988 NL88GMSX1890703281 NL46TFVH5548690248 Morbi quis mauris nec tortor egestas blandit. Nam in purus porta, accumsan felis vitae, bibendum leo. 20160122 20160123 17.71 44.34 gifts bike clothes holiday
20 NL11XOLA6707795988 NL57XWYZ7311027810 NL79XZWN0846248670 Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa. Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat. 20160122 20160123 17.12 12.96 taxes car bills groceries
21 NL11XOLA6707795988 NL53XXRC4353165917 NL52MKIO8325583045 Vivamus ultrices tortor vel semper lacinia. Duis fringilla libero eget quam pharetra, non gravida ex fermentum. 20160122 20160123 48.13 44.47 food taxes bills bills
22 NL11XOLA6707795988 NL71NZET6513049113 NL47YVJU4419567422 Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem. Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem. 20160122 20160123 30.21 17.51 food car household bills
23 NL11XOLA6707795988 NL34WNPM5967636595 NL04TNIP4218080631 Nunc sed leo scelerisque quam consectetur elementum quis consequat dui. Suspendisse tempus eros euismod leo consequat, non malesuada arcu pretium. 20160122 20160123 23.83 17.36 gifts cash household groceries
24 NL11XOLA6707795988 NL92QQAD9910045494 NL68SOAC3516744723 Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat. In scelerisque velit eget ante pharetra pretium. 20160122 20160123 18.37 34.22 food taxes studies groceries
25 NL11XOLA6707795988 NL96DQGH5594709053 NL53YVTS7223912863 Nullam malesuada orci in vulputate imperdiet. Nam in purus porta, accumsan felis vitae, bibendum leo. 20160122 20160123 34.31 27.9 car food studies other stuff
26 NL32EMMZ6999206899 NL11XOLA6707795988 NL11XOLA6707795988 NL40QRBS9553175317 In scelerisque velit eget ante pharetra pretium. Vivamus ultrices tortor vel semper lacinia. 20160122 20160123 41.03 -10.86 books and such groceries clothes holiday
27 NL72JOAK5065057265 NL11XOLA6707795988 NL11XOLA6707795988 NL79XZWN0846248670 Nullam malesuada orci in vulputate imperdiet. Duis fringilla libero eget quam pharetra, non gravida ex fermentum. 20160122 20160123 34.21 -19.57 car bike groceries household
28 NL40KZVR5107424627 NL11XOLA6707795988 NL11XOLA6707795988 NL54TZNZ2922111989 Vivamus ultrices tortor vel semper lacinia. Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa. 20160122 20160123 34.9 -12.05 taxes cash clothes holiday
29 NL78DRZM0805589694 NL11XOLA6707795988 NL11XOLA6707795988 NL04BAGX3284775110 Morbi quis mauris nec tortor egestas blandit. Aenean dictum sem pellentesque, semper est eget, ultricies magna. 20160122 20160123 27.86 -15.98 books and such groceries household bills
30 NL68TROA2774597773 NL11XOLA6707795988 NL11XOLA6707795988 NL49LULH7261231215 Proin eleifend magna et ante cursus laoreet. Nam in purus porta, accumsan felis vitae, bibendum leo. 20160122 20160123 19.62 -35.67 taxes food other stuff clothes
31 NL46WEXF3324987229 NL11XOLA6707795988 NL11XOLA6707795988 NL11YHMI8046080217 Suspendisse tempus eros euismod leo consequat, non malesuada arcu pretium. Nunc sed leo scelerisque quam consectetur elementum quis consequat dui. 20160122 20160123 34.12 -48.94 gifts dinner bills clothes
32 NL60TTSG7972999589 NL11XOLA6707795988 NL11XOLA6707795988 NL89BXNF2470379032 Vivamus ultrices tortor vel semper lacinia. Aenean dictum sem pellentesque, semper est eget, ultricies magna. 20160122 20160123 36.49 -33.82 dinner taxes other stuff holiday
33 NL20GJDZ7286831224 NL11XOLA6707795988 NL11XOLA6707795988 NL74SHGG7300113478 Nullam malesuada orci in vulputate imperdiet. In scelerisque velit eget ante pharetra pretium. 20160122 20160123 36.25 -17.36 bike food bills other stuff
34 NL70NICN4864639604 NL11XOLA6707795988 NL11XOLA6707795988 NL48ZPLO1718215436 Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat. Duis fringilla libero eget quam pharetra, non gravida ex fermentum. 20160122 20160123 15.29 -19.31 groceries food groceries holiday
35 NL66KCKB4009393114 NL11XOLA6707795988 NL11XOLA6707795988 NL13BJMO5341591615 Aenean dictum sem pellentesque, semper est eget, ultricies magna. Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa. 20160122 20160123 45.87 -28.47 taxes groceries holiday other stuff
36 NL62LELR1702168905 NL11XOLA6707795988 NL11XOLA6707795988 NL59PKVU0116767154 Duis fringilla libero eget quam pharetra, non gravida ex fermentum. Proin eleifend magna et ante cursus laoreet. 20160122 20160123 31.89 -39.24 gifts taxes household other stuff
37 NL79PBCN6122638412 NL11XOLA6707795988 NL11XOLA6707795988 NL72BQRL1220175315 Nulla a dui euismod nulla convallis dictum. Nulla in neque sed velit ultricies placerat. 20160122 20160123 35.52 -17.53 books and such groceries other stuff bills
38 NL16FBYT1696665639 NL11XOLA6707795988 NL11XOLA6707795988 NL53QHDG0329036955 Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa. Nulla a dui euismod nulla convallis dictum. 20160122 20160123 18.96 -39.45 books and such books and such groceries holiday
39 NL81QKMO3338422717 NL11XOLA6707795988 NL11XOLA6707795988 NL29RHEE6437366575 Vivamus ultrices tortor vel semper lacinia. Lorem ipsum dolor sit amet, consectetur adipiscing elit. 20160122 20160123 24.94 -23.47 taxes food studies studies
40 NL63GVZI7651340124 NL11XOLA6707795988 NL11XOLA6707795988 NL48BLDJ9721843563 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem. 20160122 20160123 32.58 -16.56 cash food other stuff other stuff
41 NL17REMH4925281321 NL11XOLA6707795988 NL11XOLA6707795988 NL48BHXI9733658006 Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem. Nulla in neque sed velit ultricies placerat. 20160122 20160123 46.01 -21.89 books and such gifts studies household
42 NL54XPIH7528269468 NL11XOLA6707795988 NL11XOLA6707795988 NL33VPSU8067103542 Vivamus ultrices tortor vel semper lacinia. Duis fringilla libero eget quam pharetra, non gravida ex fermentum. 20160122 20160123 13.43 -11.71 groceries groceries household clothes
43 NL53NOPK8565452735 NL11XOLA6707795988 NL11XOLA6707795988 NL62UDLY8957139303 Nam in purus porta, accumsan felis vitae, bibendum leo. Nunc sed leo scelerisque quam consectetur elementum quis consequat dui. 20160122 20160123 19.77 -38.08 taxes gifts holiday groceries
44 NL62ZZPH8329588521 NL11XOLA6707795988 NL11XOLA6707795988 NL28EDMD2653501341 Nulla in neque sed velit ultricies placerat. Aenean dictum sem pellentesque, semper est eget, ultricies magna. 20160122 20160123 43.43 -39.57 cash cash clothes holiday
45 NL12KOHE7606000581 NL11XOLA6707795988 NL11XOLA6707795988 NL92QMZD6854625548 In scelerisque velit eget ante pharetra pretium. Duis fringilla libero eget quam pharetra, non gravida ex fermentum. 20160122 20160123 31.07 -48.8 groceries car clothes groceries
46 NL37RYLJ9835423733 NL11XOLA6707795988 NL11XOLA6707795988 NL37VSLJ0853659915 Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa. Nulla a dui euismod nulla convallis dictum. 20160122 20160123 39.39 -34.55 bike bike clothes household
47 NL15PQBO6144269770 NL11XOLA6707795988 NL11XOLA6707795988 NL95NQHS4363870109 Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem. Suspendisse tempus eros euismod leo consequat, non malesuada arcu pretium. 20160122 20160123 20.08 -34.95 car dinner groceries studies
48 NL27WOWN6072969151 NL11XOLA6707795988 NL11XOLA6707795988 NL81LEJP9477634344 Vivamus ultrices tortor vel semper lacinia. Vivamus ultrices tortor vel semper lacinia. 20160122 20160123 46.78 -13.18 dinner dinner other stuff other stuff
49 NL60YKHO5522486392 NL11XOLA6707795988 NL11XOLA6707795988 NL14JYVJ1041891180 Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat. Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem. 20160122 20160123 34.91 -12.79 cash groceries holiday bills
50 NL61AZND8571986983 NL11XOLA6707795988 NL11XOLA6707795988 NL57SPBS0788124528 Duis fringilla libero eget quam pharetra, non gravida ex fermentum. Nam in purus porta, accumsan felis vitae, bibendum leo. 20160122 20160123 12.57 -35.53 groceries bike groceries groceries
51 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat. Proin eleifend magna et ante cursus laoreet. 20160122 20160123 22.59 34.41 groceries groceries
52 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Nullam malesuada orci in vulputate imperdiet. Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem. 20160122 20160123 36.57 35.8 dinner groceries
53 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Proin eleifend magna et ante cursus laoreet. Nam in purus porta, accumsan felis vitae, bibendum leo. 20160122 20160123 34.9 22.46 food car
54 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Curabitur vitae nisi consectetur, feugiat ipsum vitae, hendrerit sem. Nam in purus porta, accumsan felis vitae, bibendum leo. 20160122 20160123 22.87 43.74 car bike
55 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean dictum sem pellentesque, semper est eget, ultricies magna. 20160122 20160123 32.95 28.68 car dinner
56 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis fringilla libero eget quam pharetra, non gravida ex fermentum. 20160122 20160123 35.47 32.36 bike car
57 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa. Nam in purus porta, accumsan felis vitae, bibendum leo. 20160122 20160123 41.43 37.76 taxes groceries
58 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Aenean dictum sem pellentesque, semper est eget, ultricies magna. Nulla in neque sed velit ultricies placerat. 20160122 20160123 30.85 19.98 food books and such
59 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Suspendisse tempus eros euismod leo consequat, non malesuada arcu pretium. Aenean dictum sem pellentesque, semper est eget, ultricies magna. 20160122 20160123 29.28 26.57 groceries gifts
60 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Aenean dictum sem pellentesque, semper est eget, ultricies magna. Morbi quis mauris nec tortor egestas blandit. 20160122 20160123 31.86 12.09 cash books and such
61 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Aenean dictum sem pellentesque, semper est eget, ultricies magna. Vivamus ultrices tortor vel semper lacinia. 20160122 20160123 20.22 34.96 car dinner
62 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Vivamus ultrices tortor vel semper lacinia. Nullam malesuada orci in vulputate imperdiet. 20160122 20160123 29.66 16.62 cash food
63 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla a dui euismod nulla convallis dictum. 20160122 20160123 13.29 31.14 taxes car
64 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Vivamus ultrices tortor vel semper lacinia. Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat. 20160122 20160123 33.69 45.1 gifts bike
65 NL11XOLA6707795988 NL96DZCO4665940223 NL96DZCO4665940223 Pellentesque sit amet enim ac tortor euismod ullamcorper vel et massa. Donec tincidunt nibh nec diam sodales, feugiat pulvinar ante consequat. 20160122 20160123 34.7 24.92 dinner groceries

View File

@ -17,10 +17,13 @@ class ChartReportControllerTest extends TestCase
*/
public function testYearInOut()
{
// $this->be($this->user());
// $response = $this->call('GET', '/chart/report/in-out/default/20150101/20151231/1');
// $this->assertEquals(200, $response->status());
$this->markTestSkipped('Skipped because sqlite does not support DATE_FORMAT.');
$repository = $this->mock('FireflyIII\Helpers\Report\ReportQueryInterface');
$repository->shouldReceive('spentPerMonth')->once()->andReturn([]);
$repository->shouldReceive('earnedPerMonth')->once()->andReturn([]);
$this->be($this->user());
$response = $this->call('GET', '/chart/report/in-out/default/20150101/20151231/1');
$this->assertEquals(200, $response->status());
}
/**
@ -28,9 +31,12 @@ class ChartReportControllerTest extends TestCase
*/
public function testYearInOutSummarized()
{
// $this->be($this->user());
// $response = $this->call('GET', '/chart/report/in-out-sum/default/20150101/20151231/1');
// $this->assertEquals(200, $response->status());
$this->markTestSkipped('Skipped because sqlite does not support DATE_FORMAT.');
$repository = $this->mock('FireflyIII\Helpers\Report\ReportQueryInterface');
$repository->shouldReceive('spentPerMonth')->once()->andReturn([]);
$repository->shouldReceive('earnedPerMonth')->once()->andReturn([]);
$this->be($this->user());
$response = $this->call('GET', '/chart/report/in-out-sum/default/20150101/20151231/1');
$this->assertEquals(200, $response->status());
}
}

View File

@ -6,6 +6,7 @@
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
@ -15,109 +16,239 @@ class CsvControllerTest extends TestCase
{
/**
* @covers FireflyIII\Http\Controllers\CsvController::columnRoles
* @todo Implement testColumnRoles().
*/
public function testColumnRoles()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$this->be($this->user());
// create session data:
$this->session($this->getSessionData());
$response = $this->call('GET', '/csv/column_roles');
$this->assertEquals(200, $response->status());
}
/**
* @covers FireflyIII\Http\Controllers\CsvController::downloadConfig
* @todo Implement testDownloadConfig().
*/
public function testDownloadConfig()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$this->be($this->user());
$this->session($this->getSessionData());
$response = $this->call('GET', '/csv/download-config');
$this->assertEquals(200, $response->status());
}
/**
* @covers FireflyIII\Http\Controllers\CsvController::downloadConfigPage
* @todo Implement testDownloadConfigPage().
*/
public function testDownloadConfigPage()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$this->be($this->user());
$this->session($this->getSessionData());
$response = $this->call('GET', '/csv/download');
$this->assertEquals(200, $response->status());
}
/**
* @covers FireflyIII\Http\Controllers\CsvController::index
* @todo Implement testIndex().
*/
public function testIndex()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$this->be($this->user());
$response = $this->call('GET', '/csv');
$this->assertEquals(200, $response->status());
}
/**
* @covers FireflyIII\Http\Controllers\CsvController::initialParse
* @todo Implement testInitialParse().
*/
public function testInitialParse()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$this->be($this->user());
// post data:
$postData = [
'role' => [
0 => 'account-iban',
1 => 'opposing-iban',
2 => 'description',
3 => 'date-transaction',
4 => 'amount',
5 => 'category-name',
6 => 'budget-name',
],
'map' => [0 => 1, 1 => 1],
];
// create session data:
$this->session($this->getSessionData());
$response = $this->call('POST', '/csv/initial_parse', $postData);
// should be redirect
$this->assertEquals(302, $response->status());
// should be redirected to mapping:
$this->assertRedirectedToRoute('csv.map');
}
/**
* @covers FireflyIII\Http\Controllers\CsvController::initialParse
*/
public function testInitialParseNoMap()
{
$this->be($this->user());
// post data:
$postData = [
'role' => [
0 => 'account-iban',
1 => 'opposing-iban',
2 => 'description',
3 => 'date-transaction',
4 => 'amount',
5 => 'category-name',
6 => 'budget-name',
],
'map' => [],
'_token' => Session::token(),
];
// create session data:
$this->session($this->getSessionData());
$response = $this->call('POST', '/csv/initial_parse', $postData);
// should be redirect
$this->assertEquals(302, $response->status());
// should be redirected to download config:
$this->assertRedirectedToRoute('csv.download-config-page');
}
/**
* @covers FireflyIII\Http\Controllers\CsvController::map
* @todo Implement testMap().
*/
public function testMap()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$this->be($this->user());
$this->session($this->getSessionData());
$response = $this->call('GET', '/csv/map');
$this->assertEquals(200, $response->status());
}
/**
* @covers FireflyIII\Http\Controllers\CsvController::process
* @todo Implement testProcess().
*/
public function testProcess()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$this->be($this->user());
$this->session($this->getSessionData());
$response = $this->call('GET', '/csv/process');
$this->assertEquals(200, $response->status());
}
/**
* @covers FireflyIII\Http\Controllers\CsvController::saveMapping
* @todo Implement testSaveMapping().
*/
public function testSaveMapping()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$this->be($this->user());
$this->session($this->getSessionData());
$postData = [
'_token' => Session::token(),
'mapping'
=> [0 => ['NL11XOLA6707795988' => '1',],
1 => ['NL10TAPT8906262744' => '0', 'NL93UPSZ1261542703' => '0', 'NL86IHAL3264575116' => '0', 'NL63BKBO9993148806' => '0',
'NL22EZVA6611573534' => '0', 'NL40KZVR5107424627' => '0', 'NL29RHEE6437366575' => '0', 'NL63IEPJ7437420074' => '0',
'NL62HQWJ8837203470' => '0', 'NL89FPEA1494900858' => '0', 'NL76MDMU3222445567' => '0', 'NL07TDQA3309954056' => '0',
'NL35MKIY9736938778' => '0', 'NL56DNGY5455310496' => '0', 'NL17LKFR7594179781' => '0', 'NL76UJQI9524250446' => '0',
'NL45YTPP6157249080' => '0', 'NL46TFVH5548690248' => '0', 'NL79XZWN0846248670' => '0', 'NL52MKIO8325583045' => '0',
'NL47YVJU4419567422' => '0', 'NL04TNIP4218080631' => '0', 'NL68SOAC3516744723' => '0', 'NL53YVTS7223912863' => '0',
'NL40QRBS9553175317' => '0', 'NL54TZNZ2922111989' => '0', 'NL04BAGX3284775110' => '0', 'NL49LULH7261231215' => '0',
'NL11YHMI8046080217' => '0', 'NL89BXNF2470379032' => '0', 'NL74SHGG7300113478' => '0', 'NL48ZPLO1718215436' => '0',
'NL13BJMO5341591615' => '0', 'NL59PKVU0116767154' => '0', 'NL72BQRL1220175315' => '0', 'NL53QHDG0329036955' => '0',
'NL48BLDJ9721843563' => '0', 'NL48BHXI9733658006' => '0', 'NL33VPSU8067103542' => '0', 'NL62UDLY8957139303' => '0',
'NL28EDMD2653501341' => '0', 'NL92QMZD6854625548' => '0', 'NL37VSLJ0853659915' => '0', 'NL95NQHS4363870109' => '0',
'NL81LEJP9477634344' => '0', 'NL14JYVJ1041891180' => '0', 'NL57SPBS0788124528' => '0',
'NL96DZCO4665940223' => '2',],],];
$response = $this->call('POST', '/csv/save_mapping', $postData);
$this->assertEquals(302, $response->status());
$this->assertRedirectedToRoute('csv.download-config-page');
}
/**
* @covers FireflyIII\Http\Controllers\CsvController::upload
* @todo Implement testUpload().
*/
public function testUpload()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$this->be($this->user());
$file = new UploadedFile(storage_path('build/test-upload.csv'), 'test-file.csv', 'text/plain', 446);
$args = [
'_token' => Session::token(),
'date_format' => 'Ymd',
'csv_import_account' => 1,
];
$response = $this->call('POST', '/csv/upload', $args, [], ['csv' => $file]);
// csv data set:
//$this->assertSessionHas('csv-file', 'abc');
$this->assertSessionHas('csv-date-format', 'Ymd');
$this->assertSessionHas('csv-has-headers', false);
$this->assertSessionHas('csv-map', []);
$this->assertSessionHas('csv-mapped', []);
$this->assertSessionHas('csv-roles', []);
$this->assertSessionHas('csv-specifix', []);
$this->assertSessionHas('csv-import-account', 1);
$this->assertSessionHas('csv-delimiter', ',');
$this->assertEquals(302, $response->status());
}
/**
* @return string
*/
protected function createUploadedFile()
{
$original = storage_path('build/test-upload.csv');
$time = '12345';
$fileName = 'csv-upload-' . $this->user()->id . '-' . $time . '.csv.encrypted';
$fullPath = storage_path('build') . DIRECTORY_SEPARATOR . $fileName;
if (!file_exists($fullPath)) {
$content = file_get_contents($original);
$contentEncrypted = Crypt::encrypt($content);
file_put_contents($fullPath, $contentEncrypted);
}
return $fullPath;
}
/**
* @return array
*/
protected function getSessionData()
{
return [
'csv-file' => $this->createUploadedFile(),
'csv-date-format' => 'Ymd',
'csv-has-headers' => false,
'csv-import-account' => 1,
'csv-delimiter' => ',',
'csv-specifix' => ['Dummy'],
'csv-roles' => [0 => 'account-iban', 1 => 'opposing-iban', 2 => 'description', 3 => 'date-transaction', 4 => 'amount',
5 => 'category-name', 6 => 'budget-name',],
'csv-map' => [0 => 'account-iban', 1 => 'opposing-iban',],
'csv-mapped' => [0 => ['NL11XOLA6707795988' => '1',], 1 => ['NL96DZCO4665940223' => '2',]],
];
}
}