‪TYPO3CMS  9.5
PublicMethodDeprecationTraitTest.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
24 class ‪PublicMethodDeprecationTraitTest extends UnitTestCase
25 {
29  public function ‪publicMethodCanBeCalled(): void
30  {
31  $this->expectException(\RuntimeException::class);
32  $this->expectExceptionCode(1528822131);
33  (new ‪PublicMethodDeprecationTraitTextFixture())->standardPublicMethod();
34  }
35 
40  {
41  $this->expectException(\Error::class);
42  (new ‪PublicMethodDeprecationTraitTextFixture())->standardProtectedMethod();
43  }
44 
48  public function ‪notExistingMethodThrowsError(): void
49  {
50  $this->expectException(\Error::class);
51  (new ‪PublicMethodDeprecationTraitTextFixture())->doesNotExist();
52  }
53 
57  public function ‪methodMadeProtectedCanBeCalled(): void
58  {
59  $this->expectException(\RuntimeException::class);
60  $this->expectExceptionCode(1528822485);
61  (new ‪PublicMethodDeprecationTraitTextFixture())->methodMadeProtected();
62  }
63 
67  public function ‪methodMadeProtectedReturnsValue(): void
68  {
69  $this->assertEquals('foo', (new ‪PublicMethodDeprecationTraitTextFixture())->methodMadeProtectedWithReturn());
70  }
71 
76  {
77  $this->expectException(\RuntimeException::class);
78  $this->expectExceptionCode(1528822486);
79  (new ‪PublicMethodDeprecationTraitTextFixture())->methodMadeProtectedWithArguments('foo', 'bar');
80  }
81 }
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\Fixtures\PublicMethodDeprecationTraitTextFixture
Definition: PublicMethodDeprecationTraitTextFixture.php:24
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest\publicMethodCanBeCalled
‪publicMethodCanBeCalled()
Definition: PublicMethodDeprecationTraitTest.php:29
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest\methodMadeProtectedReturnsValue
‪methodMadeProtectedReturnsValue()
Definition: PublicMethodDeprecationTraitTest.php:67
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest\methodMadeProtectedCanBeCalled
‪methodMadeProtectedCanBeCalled()
Definition: PublicMethodDeprecationTraitTest.php:57
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest\protectedMethodNotHandledByTraitThrowsError
‪protectedMethodNotHandledByTraitThrowsError()
Definition: PublicMethodDeprecationTraitTest.php:39
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest
Definition: PublicMethodDeprecationTraitTest.php:25
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest\notExistingMethodThrowsError
‪notExistingMethodThrowsError()
Definition: PublicMethodDeprecationTraitTest.php:48
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest\methodMadeProtectedCanBeCalledWithArguments
‪methodMadeProtectedCanBeCalledWithArguments()
Definition: PublicMethodDeprecationTraitTest.php:75