‪TYPO3CMS  10.4
PublicMethodDeprecationTraitTest.php
Go to the documentation of this file.
1 <?php
2 
3 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 
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
22 
26 class ‪PublicMethodDeprecationTraitTest extends UnitTestCase
27 {
31  public function ‪publicMethodCanBeCalled(): void
32  {
33  $this->expectException(\RuntimeException::class);
34  $this->expectExceptionCode(1528822131);
35  (new ‪PublicMethodDeprecationTraitTextFixture())->standardPublicMethod();
36  }
37 
42  {
43  $this->expectException(\Error::class);
44  (new ‪PublicMethodDeprecationTraitTextFixture())->standardProtectedMethod();
45  }
46 
50  public function ‪notExistingMethodThrowsError(): void
51  {
52  $this->expectException(\Error::class);
53  (new ‪PublicMethodDeprecationTraitTextFixture())->doesNotExist();
54  }
55 
59  public function ‪methodMadeProtectedCanBeCalled(): void
60  {
61  $this->expectException(\RuntimeException::class);
62  $this->expectExceptionCode(1528822485);
63  (new ‪PublicMethodDeprecationTraitTextFixture())->methodMadeProtected();
64  }
65 
69  public function ‪methodMadeProtectedReturnsValue(): void
70  {
71  self::assertEquals('foo', (new ‪PublicMethodDeprecationTraitTextFixture())->methodMadeProtectedWithReturn());
72  }
73 
78  {
79  $this->expectException(\RuntimeException::class);
80  $this->expectExceptionCode(1528822486);
81  (new ‪PublicMethodDeprecationTraitTextFixture())->methodMadeProtectedWithArguments('foo', 'bar');
82  }
83 }
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\Fixtures\PublicMethodDeprecationTraitTextFixture
Definition: PublicMethodDeprecationTraitTextFixture.php:26
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest\publicMethodCanBeCalled
‪publicMethodCanBeCalled()
Definition: PublicMethodDeprecationTraitTest.php:31
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest\methodMadeProtectedReturnsValue
‪methodMadeProtectedReturnsValue()
Definition: PublicMethodDeprecationTraitTest.php:69
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest\methodMadeProtectedCanBeCalled
‪methodMadeProtectedCanBeCalled()
Definition: PublicMethodDeprecationTraitTest.php:59
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest\protectedMethodNotHandledByTraitThrowsError
‪protectedMethodNotHandledByTraitThrowsError()
Definition: PublicMethodDeprecationTraitTest.php:41
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest
Definition: PublicMethodDeprecationTraitTest.php:27
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest\notExistingMethodThrowsError
‪notExistingMethodThrowsError()
Definition: PublicMethodDeprecationTraitTest.php:50
‪TYPO3\CMS\Core\Tests\UnitDeprecated\Compatibility\PublicMethodDeprecationTraitTest\methodMadeProtectedCanBeCalledWithArguments
‪methodMadeProtectedCanBeCalledWithArguments()
Definition: PublicMethodDeprecationTraitTest.php:77