ZerosHandlingReaderTest.php
1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
require_once('traits/ImportTrait.php');
require_once('traits/SingleImportTestingTrait.php');
use Mockery as m;
class ZerosHandlingReaderTest extends TestCase {
/**
* Traits
*/
use ImportTrait;
/**
* Filename
* @var string
*/
protected $fileName = 'files/zeros.xls';
/**
* @var bool
*/
protected $noHeadings = false;
public function testDefaultGet()
{
$got = $this->loadedFile->get();
$this->assertInstanceOf('Maatwebsite\Excel\Collections\RowCollection', $got);
$this->assertCount(6, $got);
}
//
//public function testStringsAppendedPrependedWithZeros()
//{
// $got = $this->loadedFile->toArray();
//
// $this->assertContains('TEST000', $got[3]);
// $this->assertContains('000TEST', $got[4]);
//}
//
//
//public function testStringZeros()
//{
// $got = $this->loadedFile->toArray();
//
// $this->assertContains('000', $got[0]);
//}
public function testMoney()
{
$got = $this->loadedFile->toArray();
$this->assertContains((double) 0, $got[1]);
}
public function testEmptyCellHandling()
{
$got = $this->loadedFile->toArray();
$this->assertContains(null, $got[2]);
}
public function testNormalZeros()
{
$got = $this->loadedFile->toArray();
$this->assertContains((double) 0, $got[5]);
}
}