Skip to content

Commit 8de16aa

Browse files
committed
Unit tests tuning, added app permissions request
1 parent ac361a6 commit 8de16aa

6 files changed

Lines changed: 14 additions & 57 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<AppPermissionRequests AllowAppOnlyPolicy="true">
2+
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
3+
<AppPermissionRequest Scope="http://sharepoint/search" Right="QueryAsUserIgnoreAppPrincipal"/>
4+
<AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="FullControl" />
5+
<AppPermissionRequest Scope="http://sharepoint/taxonomy" Right="Read" />
6+
</AppPermissionRequests>

generator/GenerateModel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ function syncSharePointMetadataFile($fileName){
125125
file_put_contents($options['metadataPath'],$contents);
126126
$options['version'] = $latestVersion;
127127
$options['timestamp'] = date('c');
128-
file_put_contents($fileName,json_encode($options,JSON_PRETTY_PRINT));
128+
//file_put_contents($fileName,json_encode($options,JSON_PRETTY_PRINT));
129+
file_put_contents($fileName,json_encode($options));
129130
}
130131
}
131132

generator/Settings.SharePoint.json

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1 @@
1-
{
2-
"metadataPath": ".\/metadata\/SharePoint.xml",
3-
"outputPath": "..\/src\/SharePoint",
4-
"templatePath": ".\/templates\/sharepoint\/",
5-
"includeDocAnnotations": true,
6-
"docsRoot": "https:\/\/docs.microsoft.com\/en-us\/openspecs\/sharepoint_protocols\/ms-csomspt\/",
7-
"rootNamespace": "Office365\\SharePoint",
8-
"entityRootNamespace": "SP",
9-
"version": "16.0.22112.12004",
10-
"timestamp": "2022-01-31T19:42:52+02:00",
11-
"placeholder": "This file was generated by phpSPO model generator",
12-
"typeMappings": {
13-
"SP.List": "SP.SPList",
14-
"SP.ResourcePath": "SP.SPResourcePath"
15-
},
16-
"ignoredTypes": [
17-
"SP.KeyValue",
18-
"SP.SimpleDataRow",
19-
"SP.SimpleDataTable",
20-
"SP.MethodInformation",
21-
"SP.TypeInformation",
22-
"SP.PropertyInformation",
23-
"SP.ParameterInformation",
24-
"SP.WebResponseInfo",
25-
"SP.ApiMetadata",
26-
"SP.ScriptSafeDomain",
27-
"SP.PropertyValues",
28-
"SP.WebProxy",
29-
"SP.Data.*",
30-
"SP.BusinessData.*",
31-
"SP.Workflow.*",
32-
"SP.WorkManagement.OM.*",
33-
"SP.WorkflowServices.*",
34-
"SP.OAuth.*",
35-
"SP.Directory.*",
36-
"SP.Internal.*",
37-
"SP.CompliancePolicy.*",
38-
"Microsoft.*",
39-
"OBA.*",
40-
"PS.*",
41-
"SP.UI.*",
42-
"SPO.*",
43-
"MS.FileServices.*",
44-
"Collection(Microsoft.*)",
45-
"Collection(PS.*)",
46-
"SP.WorkManagement.*"
47-
],
48-
"ignoredProperties": [
49-
"Id4a81de82eeb94d6080ea5bf63e27023a"
50-
]
51-
}
1+
{"metadataPath":".\/metadata\/SharePoint.xml","outputPath":"..\/src\/SharePoint","templatePath":".\/templates\/sharepoint\/","includeDocAnnotations":true,"docsRoot":"https:\/\/docs.microsoft.com\/en-us\/openspecs\/sharepoint_protocols\/ms-csomspt\/","rootNamespace":"Office365\\SharePoint","entityRootNamespace":"SP","version":"16.0.22112.12004","timestamp":"2022-01-31T23:17:47+02:00","placeholder":"This file was generated by phpSPO model generator","typeMappings":{"SP.List":"SP.SPList","SP.ResourcePath":"SP.SPResourcePath"},"ignoredTypes":["SP.KeyValue","SP.SimpleDataRow","SP.SimpleDataTable","SP.MethodInformation","SP.TypeInformation","SP.PropertyInformation","SP.ParameterInformation","SP.WebResponseInfo","SP.ApiMetadata","SP.ScriptSafeDomain","SP.PropertyValues","SP.WebProxy","SP.Data.*","SP.BusinessData.*","SP.Workflow.*","SP.WorkManagement.OM.*","SP.WorkflowServices.*","SP.OAuth.*","SP.Directory.*","SP.Internal.*","SP.CompliancePolicy.*","Microsoft.*","OBA.*","PS.*","SP.UI.*","SPO.*","MS.FileServices.*","Collection(Microsoft.*)","Collection(PS.*)","SP.WorkManagement.*"],"ignoredProperties":["Id4a81de82eeb94d6080ea5bf63e27023a"]}

generator/metadata/SharePoint.xml

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

phpunit_phpspo.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit bootstrap="tests/bootstrap.php" colors="true">
3+
<phpunit bootstrap="tests/bootstrap.php" colors="true" beStrictAboutTestsThatDoNotTestAnything="false" >
44
<testsuites>
55
<testsuite name="Office365 SDK for PHP Test Suite">
66
<directory>./tests/</directory>

tests/sharepoint/TaxonomyTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use PHPUnit\Framework\TestCase;
1111

1212

13-
class TaxonomyTest extends TestCase
13+
class TaxonomyTest extends SharePointTestCase
1414
{
1515

1616
/**
@@ -22,8 +22,8 @@ public static function setUpBeforeClass(): void
2222
{
2323
$settings = include(__DIR__ . '/../Settings.php');
2424
$appPrincipal = new ClientCredential($settings['ClientId'],$settings['ClientSecret']);
25-
$ctx = (new ClientContext($settings['Url']))->withCredentials($appPrincipal);
26-
self::$taxSvc = new TaxonomyService($ctx);
25+
$appCtx = (new ClientContext($settings['Url']))->withCredentials($appPrincipal);
26+
self::$taxSvc = new TaxonomyService($appCtx);
2727
parent::setUpBeforeClass();
2828
}
2929

0 commit comments

Comments
 (0)