php-ext-xlswriter/tests/format_background.phpt

38 lines
795 B
PHP

--TEST--
Check for vtiful presence
--SKIPIF--
<?php if (!extension_loaded("xlswriter")) print "skip"; ?>
--FILE--
<?php
$config = [
'path' => './tests'
];
$fileObject = new \Vtiful\Kernel\Excel($config);
$fileObject = $fileObject->fileName('format_background.xlsx');
$fileHandle = $fileObject->getHandle();
$format = new \Vtiful\Kernel\Format($fileHandle);
$style = $format->background(
\Vtiful\Kernel\Format::COLOR_RED,
\Vtiful\Kernel\Format::PATTERN_LIGHT_UP
)->toResource();
$filePath = $fileObject->header(['name', 'age'])
->data([
['viest', 21],
['wjx', 21]
])
->setRow('A1', 50, $style)
->output();
var_dump($filePath);
?>
--CLEAN--
<?php
@unlink(__DIR__ . '/format_background.xlsx');
?>
--EXPECT--
string(30) "./tests/format_background.xlsx"