/** * magic method, called when we want to know if a fake property exists * or not * * if $propertyName is a dot.notation.support path, we'll attempt to * follow it to find the stated property * * @param string $propertyName * name of the property to search for * @return boolean * TRUE if the property exists (or is emulated) * FALSE otherwise */ public function __isset($propertyName) { // is the user trying to use dot.notation? if (IsDotNotationPath::checkString($propertyName)) { return HasUsingDotNotationPath::inObject($this, $propertyName); } // if we get here, the property does not exist return false; }
/** * @covers ::inObject * @dataProvider provideObjectContainersToTest */ public function testCanSearchInsideObjectContainers($container, $path, $expectedResult) { // ---------------------------------------------------------------- // setup your test // ---------------------------------------------------------------- // perform the change $actualResult = HasUsingDotNotationPath::inObject($container, $path); // ---------------------------------------------------------------- // test the results $this->assertEquals($expectedResult, $actualResult); }