|
6 | 6 |
|
7 | 7 | use PHPUnit\Framework\Attributes\Group; |
8 | 8 | use yii2\extensions\nestedsets\tests\base\AbstractNodeAppend; |
| 9 | +use yii2\extensions\nestedsets\tests\support\MSSQLConnection; |
9 | 10 |
|
| 11 | +/** |
| 12 | + * Test suite for node append and root promotion in nested sets tree behaviors using SQL Server. |
| 13 | + * |
| 14 | + * Provides comprehensive unit and integration tests for appending nodes and promoting nodes to root in nested sets tree |
| 15 | + * structures on SQL Server, ensuring correct tree structure, attribute updates, and validation logic for both |
| 16 | + * single-tree and multi-tree models. |
| 17 | + * |
| 18 | + * Inherits tests from {@see AbstractNodeAppend} to validate node append operations, strict validation scenarios, root |
| 19 | + * promotion, and XML dataset matching after structural changes, covering edge cases such as validation bypass, |
| 20 | + * attribute refresh requirements, and cross-tree operations. |
| 21 | + * |
| 22 | + * Key features. |
| 23 | + * - Covers both {@see Tree} and {@see MultipleTree} model scenarios. |
| 24 | + * - Cross-tree append operations for multi-tree models. |
| 25 | + * - Ensures correct left, right, depth, and tree attribute updates for SQL Server. |
| 26 | + * - Root promotion and attribute refresh verification. |
| 27 | + * - Validation of strict and non-strict append operations. |
| 28 | + * - XML dataset matching after structural changes. |
| 29 | + * |
| 30 | + * @see AbstractNodeAppend for test logic and scenarios. |
| 31 | + * |
| 32 | + * @copyright Copyright (C) 2023 Terabytesoftw. |
| 33 | + * @license https://opensource.org/license/bsd-3-clause BSD 3-Clause License. |
| 34 | + */ |
10 | 35 | #[Group('mssql')] |
11 | 36 | final class NodeAppendTest extends AbstractNodeAppend |
12 | 37 | { |
13 | | - protected string $driverName = 'sqlsrv'; |
14 | | - protected string|null $dsn = 'sqlsrv:Server=127.0.0.1,1433;Database=yiitest;Encrypt=no'; |
15 | | - protected string $password = 'YourStrong!Passw0rd'; |
16 | | - protected string $username = 'SA'; |
| 38 | + protected function setUp(): void |
| 39 | + { |
| 40 | + $this->driverName = MSSQLConnection::DRIVER_NAME->value; |
| 41 | + $this->dsn = MSSQLConnection::DSN->value; |
| 42 | + $this->password = MSSQLConnection::PASSWORD->value; |
| 43 | + $this->username = MSSQLConnection::USERNAME->value; |
| 44 | + |
| 45 | + parent::setUp(); |
| 46 | + } |
17 | 47 | } |
0 commit comments