Skip to content

Commit f5a0f58

Browse files
committed
pr90
2 parents 682101d + dd786f4 commit f5a0f58

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/XBase/Column/DBaseColumn.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public function __construct(
7373
$this->decimalCount = $decimalCount;
7474
}
7575

76+
$this->decimalCount = $decimalCount;
7677
$this->reserved1 = $reserved1;
7778
$this->workAreaID = $workAreaID;
7879
$this->reserved2 = $reserved2;

tests/Resources/foxpro/pr90.dbf

0 Bytes
Binary file not shown.

tests/VisualFoxproTest.php

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,18 +327,25 @@ public function testCurrency(): void
327327
self::assertSame(10412.1241, $record->getCurrency('amount'));
328328
}
329329

330+
/**
331+
* Char column `note` must have length of 300 chars.
332+
*/
330333
public function test90(): void
331334
{
332-
$table = new Table(__DIR__.'/Resources/foxpro/f5.dbf');
335+
$table = new Table(__DIR__.'/Resources/foxpro/pr90.dbf');
333336
self::assertSame(TableType::FOXPRO_MEMO, $table->getVersion());
334337
self::assertSame(18, $table->getColumnCount());
335338
self::assertSame(5, $table->getRecordCount());
336339

340+
$columnNote = $table->getColumn('note');
341+
self::assertSame(300, $columnNote->getLength());
342+
337343
/** @var FoxproRecord $record */
338344
$record = $table->nextRecord();
339345
self::assertSame('MASTER 06/27/2007 11:27', $record->getObject($table->getColumn('ucode')));
340346
self::assertSame('20070517', $record->getDateTimeObject($table->getColumn('sdate'))->format('Ymd'));
341-
self::assertSame('He will call us on the 18th to settle - 123 xp', $record->getObject($table->getColumn('note')));
347+
self::assertSame('He will call us on the 18th to settle - 123 xp', $record->getObject($columnNote));
348+
self::assertSame('He will call us on the 18th to settle - 123 xp', $record->getObject($table->getColumn('notememo')));
342349
self::assertSame(false, $record->getObject($table->getColumn('pri')));
343350
self::assertSame(false, $record->getObject($table->getColumn('autold')));
344351
self::assertSame('20070515', $record->getDateTimeObject($table->getColumn('due'))->format('Ymd'));
@@ -347,7 +354,14 @@ public function test90(): void
347354
self::assertSame(null, $record->getObject($table->getColumn('oth2')));
348355
self::assertSame(false, $record->getObject($table->getColumn('n1')));
349356
self::assertSame(108551.0, $record->getObject($table->getColumn('n2')));
350-
self::assertSame('He will call us on the 18th to settle - 123 xp', $record->getObject($table->getColumn('notememo')));
351357
self::assertSame(null, $record->getObject($table->getColumn('subject')));
358+
359+
$record = $table->nextRecord();
360+
self::assertSame(
361+
'000000000011111111112222222222333333333344444444445555555555666666666677777777778888888888999999999900000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999',
362+
$record->getObject($columnNote)
363+
);
364+
self::assertSame(false, $record->getObject($table->getColumn('pri')));
365+
self::assertSame(false, $record->getObject($table->getColumn('autold')));
352366
}
353367
}

0 commit comments

Comments
 (0)