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

Removed use of deprecated method of doctrine #119

Open
wants to merge 1 commit into
base: master
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions phpunit.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?php

use Doctrine\Common\Annotations\AnnotationRegistry;

require_once __DIR__ . '/vendor/autoload.php';

AnnotationRegistry::registerLoader('class_exists');
date_default_timezone_set('UTC');

8 changes: 0 additions & 8 deletions src/Yandex/Allure/Adapter/Annotation/AnnotationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Yandex\Allure\Adapter\Annotation;

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\Annotations\IndexedReader;

class AnnotationProvider
Expand Down Expand Up @@ -49,7 +48,6 @@ public static function getMethodAnnotations($instance, $methodName)
private static function getIndexedReader()
{
if (!isset(self::$indexedReader)) {
self::registerAnnotationNamespaces();
self::$indexedReader = new IndexedReader(self::getAnnotationReader());
}

Expand All @@ -62,18 +60,12 @@ private static function getIndexedReader()
private static function getAnnotationReader()
{
if (!isset(self::$annotationReader)) {
self::registerAnnotationNamespaces();
self::$annotationReader = new AnnotationReader();
}

return self::$annotationReader;
}

public static function registerAnnotationNamespaces()
{
AnnotationRegistry::registerUniqueLoader('class_exists');
}

/**
* Allows to ignore framework-specific annotations
* @param array $annotations
Expand Down
5 changes: 0 additions & 5 deletions test/Yandex/Allure/Adapter/AllureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Yandex\Allure\Adapter;

use Doctrine\Common\Annotations\AnnotationRegistry;
use Yandex\Allure\Adapter\Event\ClearStepStorageEvent;
use Yandex\Allure\Adapter\Event\ClearTestCaseStorageEvent;
use Yandex\Allure\Adapter\Event\StepFinishedEvent;
Expand Down Expand Up @@ -156,10 +155,6 @@ public function testTestSuiteFinishedEvent()
$this->assertEquals(1, Allure::lifecycle()->getTestSuiteStorage()->size());

$outputDirectory = sys_get_temp_dir();
AnnotationRegistry::registerAutoloadNamespace(
'JMS\Serializer\Annotation',
__DIR__ . "/../../../../vendor/jms/serializer/src"
);

Provider::setOutputDirectory($outputDirectory);
$xmlFilePath = $outputDirectory . DIRECTORY_SEPARATOR . self::TEST_SUITE_UUID . '-testsuite.xml';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Yandex\Allure\Adapter\Annotation;

use Doctrine\Common\Annotations\AnnotationException;
use Doctrine\Common\Annotations\AnnotationRegistry;
use PHPUnit\Framework\TestCase;

class AnnotationProviderTest extends TestCase
Expand All @@ -12,11 +11,6 @@ class AnnotationProviderTest extends TestCase
private const TYPE_METHOD = 'method';
private const METHOD_NAME = 'methodWithAnnotations';

public static function setUpBeforeClass(): void
{
AnnotationRegistry::registerFile(__DIR__ . '/Fixtures/TestAnnotation.php');
}

protected function tearDown(): void
{
AnnotationProvider::tearDown();
Expand Down
5 changes: 0 additions & 5 deletions test/Yandex/Allure/Adapter/XMLValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Yandex\Allure\Adapter;

use Doctrine\Common\Annotations\AnnotationRegistry;
use DOMDocument;
use PHPUnit\Framework\TestCase;
use SebastianBergmann\Exporter\Exception;
Expand Down Expand Up @@ -63,10 +62,6 @@ private function prepareDirForXML()

private function generateXML($tmpDir)
{
AnnotationRegistry::registerAutoloadNamespace(
'JMS\Serializer\Annotation',
__DIR__ . "/../../../../vendor/jms/serializer/src"
);
Model\Provider::setOutputDirectory($tmpDir);
Allure::setDefaultLifecycle();
$testSuiteStartedEvent = new TestSuiteStartedEvent(TEST_SUITE_NAME);
Expand Down