Heray-Was-Here
Server : Apache
System : Linux mail.lomejor.cr 6.8.0-1059-azure #65~22.04.1-Ubuntu SMP Thu May 28 16:59:19 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.2.31
Disable Function : NONE
Directory :  /var/www/dev/htdocs/includes/microsoft/microsoft-graph/tests/Functional/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/dev/htdocs/includes/microsoft/microsoft-graph/tests/Functional/ContactTest.php
<?php
use PHPUnit\Framework\TestCase;
use Microsoft\Graph\Test\GraphTestBase;
use Microsoft\Graph\Model;

class ContactTest extends TestCase
{
	/**
	* @group functional
	*
	* http://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/singlevaluelegacyextendedproperty_post_singlevalueextendedproperties
	*/
    public function testContactsSetGetSingleExtendedProperty()
    {
    	$graphTestBase = new GraphTestBase();
    	$client = $graphTestBase->graphClient;

    	$contact = new Model\Contact();
    	$contact->setGivenName("_Tom" . uniqid());
    	$customProperty = new Model\SingleValueLegacyExtendedProperty();
    	$namespaceGuid = "f5939744-0f22-4f03-b33c-f18a8acfa20b";
    	$mapiPropertyType = "String ";
    	$propertyName = "CustomProperty";
    	$propertyId = $mapiPropertyType . "{" . $namespaceGuid . "} Name " . $propertyName;
    	$customProperty->setId($propertyId);
    	$customProperty->setValue("My custom property value");

    	$extendedValueCollection[] = $customProperty;

    	$contact->setSingleValueExtendedProperties($extendedValueCollection);

    	$addedContact = $client->createRequest("POST", "/me/contacts")
    		                   ->attachBody($contact)
    		                   ->setReturnType(Model\Contact::class)
    		                   ->execute();

    	$this->assertNotNull($addedContact->getId());

    	$syncedContact = $client->createRequest("GET", 
    											"/me/contacts/".
    											$addedContact->getId().
    											"?\$expand=singleValueExtendedProperties(\$filter=id eq '$propertyId')"
    											)
    							->setReturnType(Model\Contact::class)
    							->execute();

    	$this->assertNotNull($syncedContact->getSingleValueExtendedProperties());
    }
}

Hry