public function testIsImplementing() { $this->assertTrue(Debugger::isImplementing(new Collection(), 'Countable')); $this->assertTrue(Debugger::isImplementing(new Collection(), '\\Countable')); $this->assertTrue(Debugger::isImplementing('MD\\Foundation\\Tests\\TestFixtures\\Collection', 'Countable')); $this->assertTrue(Debugger::isImplementing('MD\\Foundation\\Tests\\TestFixtures\\ToArrayClass', 'MD\\Foundation\\Debug\\Interfaces\\Dumpable')); $this->assertTrue(Debugger::isImplementing(new ToArrayClass(1, 'name', 5, '2013.07.30'), 'MD\\Foundation\\Debug\\Interfaces\\Dumpable')); $this->assertFalse(Debugger::isImplementing(new Collection(), 'MD\\Foundation\\Debug\\Interfaces\\Dumpable')); }
/** * Checks whether or not the data mapper supports the given class. * * All objects that can be managed by this data mapper MUST implement `ArraySerializableInterface`. * * @param string $class Class to be checked if it can be mapped with this data mapper. * * @return boolean */ public function supports($class) { return Debugger::isImplementing($class, ArraySerializableInterface::class); }