D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
cpanel
/
ea-php82
/
root
/
usr
/
share
/
tests
/
pecl
/
yaml
/
tests
/
Filename :
yaml_emit_file_basic.phpt
back
Copy
--TEST-- Test Github pull request #1 --SKIPIF-- <?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?> --INI-- serialize_precision=-1 --FILE-- <?php $addr = array( "given" => "Chris", "family"=> "Dumars", "address"=> array( "lines"=> "458 Walkman Dr. Suite #292", "city"=> "Royal Oak", "state"=> "MI", "postal"=> 48046, ), ); $invoice = array ( "invoice"=> 34843, "date"=> 980208000, "bill-to"=> $addr, "ship-to"=> $addr, "product"=> array( array( "sku"=> "BL394D", "quantity"=> 4, "description"=> "Basketball", "price"=> 450, ), array( "sku"=> "BL4438H", "quantity"=> 1, "description"=> "Super Hoop", "price"=> 2392, ), ), "tax"=> 251.42, "total"=> 4443.52, "comments"=> "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.", ); $temp_filename = dirname(__FILE__) . 'yaml_emit_file_basic.tmp'; var_dump(yaml_emit_file($temp_filename, $invoice)); var_dump(file_get_contents($temp_filename)); ?> --CLEAN-- <?php $temp_filename = dirname(__FILE__) . 'yaml_emit_file_basic.tmp'; unlink($temp_filename); ?> --EXPECT-- bool(true) string(620) "--- invoice: 34843 date: 980208000 bill-to: given: Chris family: Dumars address: lines: |- 458 Walkman Dr. Suite #292 city: Royal Oak state: MI postal: 48046 ship-to: given: Chris family: Dumars address: lines: |- 458 Walkman Dr. Suite #292 city: Royal Oak state: MI postal: 48046 product: - sku: BL394D quantity: 4 description: Basketball price: 450 - sku: BL4438H quantity: 1 description: Super Hoop price: 2392 tax: 251.42 total: 4443.52 comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. ... "