public function test_manipulation() { EngineBlock_AttributeManipulator_FileMock::setMockFileLocation(dirname(__FILE__) . '/fixtures/attribute-manipulations/'); $fileManipulator = new EngineBlock_AttributeManipulator_FileMock(); $subjectId = 'urn:collab:person:example.com:testuser'; $response = array('__' => array('destinationid' => 'https://example.com')); $attributes = array('test' => '1'); $fileManipulator->manipulate($subjectId, $attributes, $response); $this->assertEquals(array('test' => '1', 'example.com' => 'test', 'general' => 'test'), $attributes, 'Test basic manipulation'); $response['__'] = array('destinationid' => "https://example.com/test/response"); $attributes = array_merge($attributes, array('urn:mace:dir:attribute-def:mail' => '*****@*****.**')); $fileManipulator->manipulate($subjectId, $attributes, $response); $this->assertEquals(array('test' => '1', 'general' => 'test', 'email' => '*****@*****.**', 'example.com' => 'test', 'uid' => $subjectId, 'sp' => $response['__']['destinationid'], 'general' => 'test'), $attributes, "Testing attribute renaming and using the subjectId and response"); }
public static function setMockFileLocation($filePath) { self::$_mockFileLocation = $filePath; }