Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dbp-relay-base-course-bundle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
digital blueprint
Relay API Gateway
dbp-relay-base-course-bundle
Commits
54ff6f77
Commit
54ff6f77
authored
Feb 2, 2022
by
Tobias Gross-Vogt
Browse files
Options
Downloads
Patches
Plain Diff
first version with linter fixes
parent
2224026f
No related branches found
No related tags found
No related merge requests found
Pipeline
#86044
failed
Feb 2, 2022
Stage: test
Changes
23
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/Service/ExternalApi.php
+0
-46
0 additions, 46 deletions
src/Service/ExternalApi.php
src/Service/MyCustomService.php
+0
-15
0 additions, 15 deletions
src/Service/MyCustomService.php
tests/Service/ExternalApiTest.php
+0
-8
0 additions, 8 deletions
tests/Service/ExternalApiTest.php
with
0 additions
and
69 deletions
src/Service/ExternalApi.php
deleted
100644 → 0
+
0
−
46
View file @
2224026f
<?php
declare
(
strict_types
=
1
);
namespace
Dbp\Relay\CourseBundle\Service
;
use
Dbp\Relay\CourseBundle\Entity\Course
;
class
ExternalApi
implements
CourseProviderInterface
{
private
$courses
;
public
function
__construct
(
MyCustomService
$service
)
{
// Make phpstan happy
$service
=
$service
;
$this
->
courses
=
[];
$course1
=
new
Course
();
$course1
->
setIdentifier
(
'graz'
);
$course1
->
setName
(
'Graz'
);
$course2
=
new
Course
();
$course2
->
setIdentifier
(
'vienna'
);
$course2
->
setName
(
'Vienna'
);
$this
->
courses
[]
=
$course1
;
$this
->
courses
[]
=
$course2
;
}
public
function
getCourseById
(
string
$identifier
):
?Course
{
foreach
(
$this
->
courses
as
$course
)
{
if
(
$course
->
getIdentifier
()
===
$identifier
)
{
return
$course
;
}
}
return
null
;
}
public
function
getCourses
():
array
{
return
$this
->
courses
;
}
}
This diff is collapsed.
Click to expand it.
src/Service/MyCustomService.php
deleted
100644 → 0
+
0
−
15
View file @
2224026f
<?php
declare
(
strict_types
=
1
);
namespace
Dbp\Relay\CourseBundle\Service
;
class
MyCustomService
{
private
$someConfig
;
public
function
__construct
(
string
$someConfig
)
{
$this
->
$someConfig
=
$someConfig
;
}
}
This diff is collapsed.
Click to expand it.
tests/Service/ExternalApiTest.php
+
0
−
8
View file @
54ff6f77
...
@@ -4,23 +4,15 @@ declare(strict_types=1);
...
@@ -4,23 +4,15 @@ declare(strict_types=1);
namespace
Dbp\Relay\CourseBundle\Tests\Service
;
namespace
Dbp\Relay\CourseBundle\Tests\Service
;
use
Dbp\Relay\CourseBundle\Service\ExternalApi
;
use
Dbp\Relay\CourseBundle\Service\MyCustomService
;
use
Symfony\Bundle\FrameworkBundle\Test\WebTestCase
;
use
Symfony\Bundle\FrameworkBundle\Test\WebTestCase
;
class
ExternalApiTest
extends
WebTestCase
class
ExternalApiTest
extends
WebTestCase
{
{
private
$api
;
protected
function
setUp
():
void
protected
function
setUp
():
void
{
{
$service
=
new
MyCustomService
(
'test-42'
);
$this
->
api
=
new
ExternalApi
(
$service
);
}
}
public
function
test
()
public
function
test
()
{
{
$this
->
assertTrue
(
true
);
$this
->
assertNotNull
(
$this
->
api
);
}
}
}
}
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment