Skip to content

Commit

Permalink
Merge pull request #4 from oat-sa/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ekkinox authored Apr 8, 2021
2 parents d900572 + 5de7141 commit 13f3fcc
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 12 deletions.
33 changes: 33 additions & 0 deletions .Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
pipeline {
agent {
label 'master'
}
stages {
stage('Tests') {
agent {
docker {
image 'alexwijn/docker-git-php-composer'
reuseNode true
}
}
environment {
HOME = '.'
}
options {
skipDefaultCheckout()
}
steps {
withCredentials([string(credentialsId: 'jenkins_github_token', variable: 'GIT_TOKEN')]) {
sh(
label: 'Install/Update sources from Composer',
script: "COMPOSER_AUTH='{\"github-oauth\": {\"github.com\": \"$GIT_TOKEN\"}}\' composer update --no-interaction --no-ansi --no-progress"
)
}
sh(
label: 'Run backend tests',
script: './vendor/bin/phpunit'
)
}
}
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ You can then find below usage tutorials, presented by topics.

### Messages

- how to [implement the proctoring workflow (for platform and / or tool)](doc/message/proctoring-workflow.md)
- how to [implement the proctoring messages workflow (for platform and / or tool)](doc/message/proctoring-workflow.md)

### Services

Expand Down
9 changes: 5 additions & 4 deletions doc/service/tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ $control = new AcsControl(...);

/** @var AcsControlResultInterface $controlResult */
$controlResult = $acsClient->sendControlForPayload(
$registration, // [required] as the tool, it will call the platform of this registration
$payload, // [required] from the LTI message payload containing the ACS claim (got at LTI launch)
$control // [required] with provided ACS control
$registration, // [required] as the tool, it will call the platform of this registration
$control, // [required] with provided ACS control
$payload // [required] from the LTI message payload containing the ACS claim (got at LTI launch)

);

// or you also can call directly for an given URL (avoid claim construction)
// or you also can call directly for an given URL (avoid payload construction)
/** @var AcsControlResultInterface $controlResult */
$controlResult = $acsClient->sendControl(
$registration, // [required] as the tool, it will call the platform of this registration
Expand Down
4 changes: 2 additions & 2 deletions src/Service/Client/AcsServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public function __construct(
*/
public function sendControlForPayload(
RegistrationInterface $registration,
LtiMessagePayloadInterface $payload,
AcsControlInterface $control
AcsControlInterface $control,
LtiMessagePayloadInterface $payload
): AcsControlResultInterface {
try {
$acsClaim = $payload->getAcs();
Expand Down
10 changes: 5 additions & 5 deletions tests/Integration/Service/Client/AcsServiceClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public function testSendControlForPayloadSuccess(): void
->method('getAcs')
->willReturn($acsClaim);

$result = $this->subject->sendControlForPayload($registration, $payloadMock, $control);
$result = $this->subject->sendControlForPayload($registration, $control, $payloadMock);

$this->assertInstanceOf(AcsControlResultInterface::class, $result);
$this->assertEquals($controlResult, $result);
Expand All @@ -271,8 +271,8 @@ public function testSendControlForPayloadFailureOnMissingAcsClaim(): void

$this->subject->sendControlForPayload(
$registration,
$payloadMock,
$this->createMock(AcsControlInterface::class)
$this->createMock(AcsControlInterface::class),
$payloadMock
);
}

Expand Down Expand Up @@ -306,8 +306,8 @@ public function testSendControlForPayloadFailureOnInvalidAcsAction(): void

$this->subject->sendControlForPayload(
$registration,
$payloadMock,
$control
$control,
$payloadMock
);
}
}

0 comments on commit 13f3fcc

Please sign in to comment.