-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
495c694
commit 4da1bcc
Showing
27 changed files
with
656 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env php | ||
|
||
<?php | ||
|
||
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Application\Kernel; | ||
use Symfony\Bundle\FrameworkBundle\Console\Application; | ||
|
||
|
||
if (!is_file(dirname(__DIR__).'/../../vendor/autoload_runtime.php')) { | ||
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".'); | ||
} | ||
|
||
require_once dirname(__DIR__).'/../../vendor/autoload_runtime.php'; | ||
|
||
return function () { | ||
$kernel = new Kernel('test', true); | ||
|
||
return new Application($kernel); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
doctrine: | ||
dbal: | ||
url: 'sqlite:///%kernel.project_dir%/var/app.db' | ||
profiling_collect_backtrace: '%kernel.debug%' | ||
orm: | ||
auto_generate_proxy_classes: true | ||
enable_lazy_ghost_objects: true | ||
validate_xml_mapping: true | ||
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware | ||
auto_mapping: true | ||
report_fields_where_declared: true | ||
mappings: | ||
FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Application: | ||
type: attribute | ||
is_bundle: false | ||
dir: '%kernel.project_dir%/src/Entity' | ||
prefix: 'FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Application\Entity' | ||
alias: FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
doctrine_migrations: | ||
migrations_paths: | ||
'FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Application\Migrations': '%kernel.project_dir%/migrations' | ||
enable_profiler: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
framework: | ||
secret: ThisIsSecret | ||
test: true | ||
fragments: { path: /_fragment } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
monolog: | ||
channels: | ||
- deprecation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
twig: | ||
default_path: '%kernel.project_dir%/templates' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Application\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ | ||
final class Version20240229075814 extends AbstractMigration | ||
{ | ||
public function getDescription(): string | ||
{ | ||
return 'Default schema'; | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
$this->addSql('CREATE TABLE dummy (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL COLLATE "BINARY")'); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
$this->addSql('DROP TABLE dummy'); | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
namespace FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Application\Controller; | ||
|
||
use Doctrine\ORM\EntityManagerInterface; | ||
use FriendsOfOpenTelemetry\OpenTelemetryBundle\Tests\Application\Entity\Dummy; | ||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\Routing\Attribute\Route; | ||
|
||
class DummyController extends AbstractController | ||
{ | ||
#[Route('/ok', methods: ['GET'])] | ||
public function ok(): Response | ||
{ | ||
return $this->json([ | ||
'status' => 'ok', | ||
]); | ||
} | ||
|
||
#[Route('/failure', methods: ['GET'])] | ||
public function failure(): Response | ||
{ | ||
return $this->json([ | ||
'status' => 'failure', | ||
], Response::HTTP_SERVICE_UNAVAILABLE); | ||
} | ||
|
||
#[Route('/exception', methods: ['GET'])] | ||
public function exception(): Response | ||
{ | ||
throw new \RuntimeException('Oops'); | ||
} | ||
|
||
#[Route('/view', methods: ['GET'])] | ||
public function view(): Response | ||
{ | ||
return $this->render('dummy.html.twig'); | ||
} | ||
|
||
#[Route('/fragment', methods: ['GET'])] | ||
public function segment(): Response | ||
{ | ||
return $this->render('fragment.html.twig'); | ||
} | ||
|
||
#[Route('/dummy/{dummy}', methods: ['GET'])] | ||
public function viewDummy(Dummy $dummy): Response | ||
{ | ||
return $this->json([ | ||
'id' => $dummy->id, | ||
'name' => $dummy->name, | ||
]); | ||
} | ||
|
||
#[Route('/dummy', methods: ['POST'])] | ||
public function createDummy(EntityManagerInterface $entityManager, Request $request): Response | ||
{ | ||
$name = $request->get('name'); | ||
|
||
$dummy = new Dummy(name: $name); | ||
$entityManager->persist($dummy); | ||
$entityManager->flush(); | ||
|
||
return $this->json([ | ||
'id' => $dummy->id, | ||
'name' => $dummy->name, | ||
]); | ||
} | ||
} |
Oops, something went wrong.