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

Create cache data fixtures for test evironment #535

Merged
merged 3 commits into from
Oct 4, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
coverage: "pcov"

- name: "Build website"
run: "./bin/console --env=test build-all"
run: "./bin/console --env=dev build-all"

- name: "Run PHP tests with coverage"
run: "./vendor/bin/phpunit --coverage-clover clover.xml"
Expand Down
3 changes: 3 additions & 0 deletions config/config_test.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
imports:
- { resource: config.yml }

parameters:
doctrine.website.cache_dir: 'tests/test-cache'
6 changes: 3 additions & 3 deletions tests/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public function testProjectVersionsAndTags(): void

$tags = $firstVersion->getTags();

self::assertCount(14, $tags);
self::assertCount(3, $tags);

self::assertSame('2.0.7', $firstVersion->getLatestTag()->getName());
self::assertSame('2.0.0-BETA1', $firstVersion->getFirstTag()->getName());
self::assertSame('2.0.2', $firstVersion->getLatestTag()->getName());
self::assertSame('2.0.0', $firstVersion->getFirstTag()->getName());
}

public function testHomepageEditLink(): void
Expand Down
29 changes: 29 additions & 0 deletions tests/test-cache/data/blog_posts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"url": "/1.html",
"slug": "one",
"title": "One",
"authorName": "me",
"authorEmail": "",
"contents": "Doctrine Blog 1",
"date": "2023-09-18 00:00:00"
},
{
"url": "/2.html",
"slug": "two",
"title": "Two",
"authorName": "you",
"authorEmail": "",
"contents": "Doctrine Blog 2",
"date": "2023-10-29 00:00:00"
},
{
"url": "/3.html",
"slug": "three",
"title": "Three",
"authorName": "we",
"authorEmail": "",
"contents": "Doctrine Blog 3",
"date": "2009-12-31 00:00:00"
}
]
25 changes: 25 additions & 0 deletions tests/test-cache/data/contributors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"username1": {
"isTeamMember": false,
"github": "username1",
"avatarUrl": "https://avatars.githubusercontent.com/u/1?v=4",
"numCommits": 1,
"numAdditions": 2,
"numDeletions": 3,
"projects": [
"annotations"
]
},
"username2": {
"isTeamMember": true,
"github": "username2",
"avatarUrl": "https://avatars.githubusercontent.com/u/2?v=4",
"numCommits": 4,
"numAdditions": 5,
"numDeletions": 6,
"projects": [
"orm",
"dbal"
]
}
}
22 changes: 22 additions & 0 deletions tests/test-cache/data/project_contributors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"isTeamMember": false,
"isMaintainer": false,
"projectSlug": "annotations",
"github": "username1",
"avatarUrl": "https://avatars.githubusercontent.com/u/1?v=4",
"numCommits": 1,
"numAdditions": 2,
"numDeletions": 3
},
{
"isTeamMember": true,
"isMaintainer": true,
"projectSlug": "annotations",
"github": "username2",
"avatarUrl": "https://avatars.githubusercontent.com/u/2?v=4",
"numCommits": 4,
"numAdditions": 5,
"numDeletions": 6
}
]
Loading