This repository has been archived by the owner on Sep 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from macieq/master
Fix for creating empty tags for all 'false' PHP values. Fixes issue #14
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace CFPropertyList; | ||
|
||
error_reporting(E_ALL | E_STRICT); | ||
ini_set('display_errors', 'on'); | ||
|
||
if (!defined('LIBDIR')) { | ||
define('LIBDIR', __DIR__ . '/../classes/CFPropertyList'); | ||
} | ||
|
||
require_once(LIBDIR . '/CFPropertyList.php'); | ||
|
||
class EmptyElementsTest extends \PHPUnit_Framework_TestCase { | ||
public function testWriteFile() { | ||
$expected = '<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"><dict><key>string</key><string/><key>number</key><integer>0</integer><key>double</key><real>0</real></dict></plist> | ||
'; | ||
|
||
$plist = new CFPropertyList(); | ||
$dict = new CFDictionary(); | ||
|
||
$dict->add('string', new CFString('')); | ||
$dict->add('number', new CFNumber(0)); | ||
$dict->add('double', new CFNumber(0.0)); | ||
|
||
$plist->add($dict); | ||
$this->assertEquals($expected, $plist->toXML()); | ||
} | ||
} |
9ed6aa6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, this I found a bug.
For example: Chinese messy code
I change the key value,(use "example-modify-01.php")
{
if( $key == "DisplayName" )
{
$value->setValue( '淘宝2' );
}
}
Save for plist,
I found that I have is
{
DisplayName
Ա2吿㼿
}
Believe that other language is also has the same problem, if you have already solved, can you tell me?
Thank you very much. email:iamleetvin@gmail.com