@@ -47,10 +47,16 @@ public function testGenerate(): void
4747 ! \$this->connection->getDatabasePlatform() instanceof \\ $ expectedPlatform,
4848 "Migration can only be executed safely on '\\ $ expectedPlatform'."
4949 );
50-
51- \$this->addSql('SELECT 1');
52- \$this->addSql('SELECT 2');
53- \$this->addSql('%s');
50+
51+ \$this->addSql(<<<'SQL'
52+ SELECT 1
53+ SQL);
54+ \$this->addSql(<<<'SQL'
55+ SELECT 2
56+ SQL);
57+ \$this->addSql(<<<'SQL'
58+ %s
59+ SQL);
5460 CODE ,
5561 );
5662
@@ -65,9 +71,15 @@ public function testGenerationWithoutCheckingDatabasePlatform(): void
6571
6672 $ expectedCode = $ this ->prepareGeneratedCode (
6773 <<<'CODE'
68- $this->addSql('SELECT 1');
69- $this->addSql('SELECT 2');
70- $this->addSql('%s');
74+ $this->addSql(<<<'SQL'
75+ SELECT 1
76+ SQL);
77+ $this->addSql(<<<'SQL'
78+ SELECT 2
79+ SQL);
80+ $this->addSql(<<<'SQL'
81+ %s
82+ SQL);
7183 CODE,
7284 );
7385
@@ -82,9 +94,15 @@ public function testGenerationWithoutCheckingDatabasePlatformWithConfiguration()
8294
8395 $ expectedCode = $ this ->prepareGeneratedCode (
8496 <<<'CODE'
85- $this->addSql('SELECT 1');
86- $this->addSql('SELECT 2');
87- $this->addSql('%s');
97+ $this->addSql(<<<'SQL'
98+ SELECT 1
99+ SQL);
100+ $this->addSql(<<<'SQL'
101+ SELECT 2
102+ SQL);
103+ $this->addSql(<<<'SQL'
104+ %s
105+ SQL);
88106 CODE,
89107 );
90108
@@ -119,7 +137,13 @@ private function prepareGeneratedCode(string $expectedCode): string
119137
120138 return sprintf (
121139 $ expectedCode ,
122- (new SqlFormatter (new NullHighlighter ()))->format ($ this ->sql [2 ]),
140+ implode (
141+ PHP_EOL . str_repeat (' ' , 4 ),
142+ explode (
143+ PHP_EOL ,
144+ (new SqlFormatter (new NullHighlighter ()))->format ($ this ->sql [2 ]),
145+ ),
146+ ),
123147 );
124148 }
125149}
0 commit comments