Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request zendframework/zendframework#7393 from samsonasik/i…
Browse files Browse the repository at this point in the history
…mplement-todo-write-more-tests

implements @todo write more tests for Zend\Ldap\Converter::toLdap()
  • Loading branch information
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/Converter/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public static function hex32ToAsc($string)
* By setting the <var>$type</var>-parameter the conversion of a certain
* type can be forced
*
* @todo write more tests
*
* @param mixed $value The value to convert
* @param int $type The conversion type to use
Expand Down
10 changes: 9 additions & 1 deletion test/Converter/ConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use DateTime;
use DateTimeZone;
use stdClass;
use Zend\Ldap\Converter\Converter;

/**
Expand Down Expand Up @@ -136,7 +137,14 @@ public function toLdapProvider()
'type' => 1)),
array('19700101000000Z', array('value'=> DateTime::createFromFormat(DateTime::ISO8601, '1970-01-01T00:00:00+0000'),
'type' => 0)),

array(Converter::toldapBoolean(true), array('value' => (bool) true,
'type' => 0)),
array(Converter::toLdapSerialize(new stdClass()), array('value' => new stdClass(),
'type' => 0)),
array(Converter::toLdapSerialize(array('foo')), array('value' => array('foo'),
'type' => 0)),
array(stream_get_contents(fopen(__FILE__, 'r')), array('value' => fopen(__FILE__, 'r'),
'type' => 0)),
);
}

Expand Down

0 comments on commit 52fb2c0

Please sign in to comment.