public function testWithCallbackToken() { //Create our expected item, get our class to build our item, then compare $expected = ExchangeWebServices::fromCallbackToken('test.com', 'token', ['version' => ExchangeWebServices::VERSION_2010]); $client = API::withCallbackToken('test.com', 'token'); $actual = $client->getClient(); $ntlmSoapReflection = new \ReflectionClass(API\NTLMSoapClient::class); $reflectedProp = $ntlmSoapReflection->getProperty('auth'); $reflectedProp->setAccessible(true); $this->assertEquals($reflectedProp->getValue($expected->getClient()), $reflectedProp->getValue($actual->getClient())); }
public function testPrimarySmtpMailbox() { $client = $this->getClientMock(); $this->assertNull($client->getPrimarySmtpMailbox()); $this->assertNull($client->getPrimarySmtpEmailAddress()); $expectedMailbox = new Type\EmailAddressType(); $expectedMailbox->setEmailAddress('*****@*****.**'); $client->setPrimarySmtpEmailAddress('*****@*****.**'); $this->assertEquals($client->getPrimarySmtpMailbox(), $expectedMailbox); $this->assertEquals($client->getPrimarySmtpEmailAddress(), '*****@*****.**'); $client = ExchangeWebServices::fromUsernameAndPassword('*****@*****.**', 'user', 'password', ['primarySmtpEmailAddress' => '*****@*****.**']); $this->assertEquals($client->getPrimarySmtpMailbox(), $expectedMailbox); $this->assertEquals($client->getPrimarySmtpEmailAddress(), '*****@*****.**'); $client = ExchangeWebServices::fromUsernameAndPassword('*****@*****.**', 'user', 'password', ['impersonation' => '*****@*****.**']); $this->assertEquals($client->getPrimarySmtpMailbox(), $expectedMailbox); $this->assertEquals($client->getPrimarySmtpEmailAddress(), '*****@*****.**'); }
public function moveItem(Type\ItemIdType $itemId, Type\FolderIdType $folderId, $options = array()) { $request = array('ToFolderId' => array('FolderId' => $folderId->toArray()), 'ItemIds' => array('ItemId' => $itemId->toArray())); $request = array_merge_recursive($request, $options); return $this->client->MoveItem($request); }