Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #4

Merged
merged 4 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
);
}
}