Skip to content

Added ramsey/uuid ^4.0 #83

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

Open
wants to merge 2 commits into
base: 3.x
Choose a base branch
from
Open
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
16 changes: 5 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,11 @@ jobs:

strategy:
matrix:
include:
- php-version: '7.1'
composer-options: '--prefer-stable'
- php-version: '7.2'
composer-options: '--prefer-lowest --prefer-stable'
- php-version: '7.3'
composer-options: '--prefer-stable'
- php-version: '7.4'
composer-options: '--prefer-stable'
- php-version: '8.0'
composer-options: '--prefer-stable'
php-version:
- '7.4'
- '8.0'
- '8.1'
- '8.2'

steps:
- name: 'Check out'
Expand Down
19 changes: 9 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
}
],
"require": {
"php": "^7.1 || ^8.0",
"php-xapi/exception": "~0.1",
"ramsey/uuid": "^2.9 || ^3.0"
"php": "^7.4 || ^8.0",
"php-xapi/exception": "v1.0.0-rc.1 as 1.0.0",
"ramsey/uuid": "^3.0 || ^4.0"
},
"require-dev": {
"phpspec/phpspec": "^5.0 || ^6.0 || ^7.0"
"phpspec/phpspec": "^6.0 || ^7.0"
},
"conflict": {
"xabbuh/xapi-model": "*"
Expand All @@ -32,11 +32,10 @@
"spec\\Xabbuh\\XApi\\Model\\": "spec/"
}
},
"extra": {
"branch-alias": {
"1.x-dev": "1.2.x-dev",
"2.x-dev": "2.2.x-dev",
"3.x-dev": "3.2.x-dev"
"repositories": [
{
"type": "git",
"url": "https://github.com/erickr/php-xapi-exception.git"
}
}
]
}
22 changes: 14 additions & 8 deletions spec/ActivityProfileDocumentSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@

class ActivityProfileDocumentSpec extends ObjectBehavior
{
function let()
public function let()
{
$this->beConstructedWith(new ActivityProfile('id', new Activity(IRI::fromString('http://tincanapi.com/conformancetest/activityid'))), new DocumentData(array(
'x' => 'foo',
'y' => 'bar',
)));
$this->beConstructedWith(new ActivityProfile('id',
new Activity(IRI::fromString('http://tincanapi.com/conformancetest/activityid'))),
new DocumentData(array(
'x' => 'foo',
'y' => 'bar',
)
)
);
}

function it_is_a_document()
Expand All @@ -35,11 +39,13 @@ function it_is_a_document()

function its_data_can_be_read()
{
$this->offsetExists('x')->shouldReturn(true);
//$this->offsetExists('x')->shouldReturn(true);
$this->shouldHaveKey('x');
$this->offsetGet('x')->shouldReturn('foo');
$this->offsetExists('y')->shouldReturn(true);
//$this->offsetExists('y')->shouldReturn(true);
$this->shouldHaveKey('y');
$this->offsetGet('y')->shouldReturn('bar');
$this->offsetExists('z')->shouldReturn(false);
//$this->offsetExists('z')->shouldReturn(false);
}

function it_throws_exception_when_not_existing_data_is_being_read()
Expand Down
6 changes: 3 additions & 3 deletions spec/AgentProfileDocumentSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ function it_is_a_document()

function its_data_can_be_read()
{
$this->offsetExists('x')->shouldReturn(true);
$this->shouldHaveKey('x');
$this->offsetGet('x')->shouldReturn('foo');
$this->offsetExists('y')->shouldReturn(true);
$this->shouldHaveKey('y');
$this->offsetGet('y')->shouldReturn('bar');
$this->offsetExists('z')->shouldReturn(false);
$this->shouldNotHaveKey('z');
}

function it_throws_exception_when_not_existing_data_is_being_read()
Expand Down
6 changes: 3 additions & 3 deletions spec/ExtensionsSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ function its_extensions_can_be_read()
$extensions->attach(IRI::fromString('http://id.tincanapi.com/extension/starting-position'), 1);
$this->beConstructedWith($extensions);

$this->offsetExists(IRI::fromString('http://id.tincanapi.com/extension/topic'))->shouldReturn(true);
$this->shouldHaveKey(IRI::fromString('http://id.tincanapi.com/extension/topic'));
$this->offsetGet(IRI::fromString('http://id.tincanapi.com/extension/topic'))->shouldReturn('Conformance Testing');

$this->offsetExists(IRI::fromString('http://id.tincanapi.com/extension/color'))->shouldReturn(true);
$this->shouldHaveKey(IRI::fromString('http://id.tincanapi.com/extension/color'));
$this->offsetGet(IRI::fromString('http://id.tincanapi.com/extension/color'))->shouldReturn(array(
'model' => 'RGB',
'value' => '#FFFFFF',
));

$this->offsetExists(IRI::fromString('http://id.tincanapi.com/extension/starting-position'))->shouldReturn(true);
$this->shouldHaveKey(IRI::fromString('http://id.tincanapi.com/extension/starting-position'));
$this->offsetGet(IRI::fromString('http://id.tincanapi.com/extension/starting-position'))->shouldReturn(1);

$returnedExtensions = $this->getExtensions();
Expand Down
12 changes: 9 additions & 3 deletions spec/Interaction/InteractionDefinitionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@
use Xabbuh\XApi\Model\Definition;
use Xabbuh\XApi\Model\Interaction\InteractionDefinition;

abstract class InteractionDefinitionSpec extends DefinitionSpec
class InteractionDefinitionSpec extends DefinitionSpec
{
function it_is_a_definition()

protected function createEmptyDefinition()
{
$this->shouldHaveType(Definition::class);
return new InteractionDefinition();
}

public function it_is_a_definition()
{
$this->shouldHaveType(InteractionDefinition::class);
}

function it_is_an_interaction()
Expand Down
8 changes: 4 additions & 4 deletions spec/LanguageMapSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ function it_can_be_created_with_an_existing_array_map()
function it_returns_a_new_instance_with_an_added_entry()
{
$languageTag = $this->withEntry('en-US', 'attended');
$languageTag->offsetExists('en-US')->shouldReturn(true);
$languageTag->shouldHaveKey('en-US');
$languageTag->shouldNotBe($this);
$this->offsetExists('en-US')->shouldReturn(false);
$this->offsetExists('en-US');
}

function it_returns_a_new_instance_with_a_modified_entry()
Expand All @@ -65,8 +65,8 @@ function it_throws_an_exception_when_a_non_existent_language_tag_is_requested()

function it_can_be_asked_if_a_language_tag_is_known()
{
$this->offsetExists('en-GB')->shouldReturn(true);
$this->offsetExists('en-US')->shouldReturn(false);
$this->shouldHaveKey('en-GB');
$this->shouldNotHaveKey('en-US');
}

function its_values_cannot_be_modified()
Expand Down
6 changes: 3 additions & 3 deletions spec/StateDocumentSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ function it_is_a_document()

function its_data_can_be_read()
{
$this->offsetExists('x')->shouldReturn(true);
$this->shouldHaveKey('x');
$this->offsetGet('x')->shouldReturn('foo');
$this->offsetExists('y')->shouldReturn(true);
$this->shouldHaveKey('y');
$this->offsetGet('y')->shouldReturn('bar');
$this->offsetExists('z')->shouldReturn(false);
$this->shouldNotHaveKey('z');
}

function it_throws_exception_when_not_existing_data_is_being_read()
Expand Down
2 changes: 1 addition & 1 deletion src/Interaction/InteractionDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
* @author Christian Flothmann <[email protected]>
*/
abstract class InteractionDefinition extends Definition
class InteractionDefinition extends Definition
{
private $correctResponsesPattern;

Expand Down