/usr/share/php/tests/Horde_Injector/Horde/Injector/BinderTest.php is in php-horde-injector 2.0.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | <?php
class Horde_Injector_BinderTest extends Horde_Test_Case
{
/**
* provider returns binder1, binder2, shouldEqual, errmesg
*/
public function binderIsEqualProvider()
{
$df = new Horde_Injector_DependencyFinder();
return array(
array(
new Horde_Injector_Binder_Implementation('foobar', $df),
new Horde_Injector_Binder_Factory('factory', 'method'),
false, "Implementation_Binder should not equal Factory binder"
),
array(
new Horde_Injector_Binder_Implementation('foobar', $df),
new Horde_Injector_Binder_Implementation('foobar', $df),
true, "Implementation Binders both reference concrete class foobar"
),
array(
new Horde_Injector_Binder_Implementation('foobar', $df),
new Horde_Injector_Binder_Implementation('otherimpl', $df),
false, "Implementation Binders do not have same implementation set"
),
array(
new Horde_Injector_Binder_Factory('factory', 'method'),
new Horde_Injector_Binder_Implementation('foobar', $df),
false, "Implementation_Binder should not equal Factory binder"
),
array(
new Horde_Injector_Binder_Factory('foobar', 'create'),
new Horde_Injector_Binder_Factory('foobar', 'create'),
true, "Factory Binders both reference factory class foobar::create"
),
array(
new Horde_Injector_Binder_Factory('foobar', 'create'),
new Horde_Injector_Binder_Factory('otherimpl', 'create'),
false, "Factory Binders do not have same factory class set, so they should not be equal"
),
array(
new Horde_Injector_Binder_Factory('foobar', 'create'),
new Horde_Injector_Binder_Factory('foobar', 'otherMethod'),
false, "Factory Binders are set to the same class but different methods. They should not be equal"
),
);
}
/**
* @dataProvider binderIsEqualProvider
*/
public function testBinderEqualFunction($binderA, $binderB, $shouldEqual, $message)
{
$this->assertEquals($shouldEqual, $binderA->equals($binderB), $message);
}
}
|