Files
Chamilo/vendor/sabre/vobject/tests/VObject/TestCase.php
T
Xes 73154ae174
Behat tests 1.11.x 🐞 / PHP 7.4 Test on ubuntu-latest (push) Canceled after 0s
PHP-CS-Fixer / composer_install (7.4) (push) Canceled after 0s
Chamilo 1.11.40 (ZIP oficial v1.11.40)
Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip
sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439
Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
2026-08-06 17:59:45 +02:00

51 lines
1.3 KiB
PHP

<?php
namespace Sabre\VObject;
class TestCase extends \PHPUnit_Framework_TestCase {
/**
* This method tests wether two vcards or icalendar objects are
* semantically identical.
*
* It supports objects being supplied as strings, streams or
* Sabre\VObject\Component instances.
*
* PRODID is removed from both objects as this is often variable.
*
* @param resource|string|Component $expected
* @param resource|string|Component $actual
* @param string $message
*/
function assertVObjEquals($expected, $actual, $message = '') {
$self = $this;
$getObj = function($input) use ($self) {
if (is_resource($input)) {
$input = stream_get_contents($input);
}
if (is_string($input)) {
$input = Reader::read($input);
}
if (!$input instanceof Component) {
$this->fail('Input must be a string, stream or VObject component');
}
unset($input->PRODID);
return $input;
};
$expected = $getObj($expected);
$actual = $getObj($actual);
$this->assertEquals(
$expected->serialize(),
$actual->serialize(),
$message
);
}
}