Skip to content

Commit d3489bd

Browse files
Merge branch '7.x' into 8.x
2 parents 8af4f77 + c6cf381 commit d3489bd

File tree

5 files changed

+88
-4
lines changed

5 files changed

+88
-4
lines changed

CHANGELOG-6.x.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Release Notes for 6.x
22

3-
## [Unreleased](https://github.com/laravel/framework/compare/v6.18.37...6.x)
3+
## [Unreleased](https://github.com/laravel/framework/compare/v6.18.38...6.x)
4+
5+
6+
## [v6.18.38 (2020-09-01)](https://github.com/laravel/framework/compare/v6.18.37...v6.18.38)
7+
8+
### Changed
9+
- Changed postgres processor ([#34055](https://github.com/laravel/framework/pull/34055))
410

511

612
## [v6.18.37 (2020-08-27)](https://github.com/laravel/framework/compare/v6.18.36...v6.18.37)

CHANGELOG-7.x.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# Release Notes for 7.x
22

3-
## [Unreleased](https://github.com/laravel/framework/compare/v7.26.1...7.x)
3+
## [Unreleased](https://github.com/laravel/framework/compare/v7.27.0...7.x)
4+
5+
6+
## [v7.27.0 (2020-09-01)](https://github.com/laravel/framework/compare/v7.26.1...v7.27.0)
7+
8+
### Added
9+
- Allow to use alias of morphed model ([#34032](https://github.com/laravel/framework/pull/34032))
10+
- Introduced basic padding (both, left, right) methods to Str and Stringable ([#34053](https://github.com/laravel/framework/pull/34053))
11+
12+
### Refactoring
13+
- RefreshDatabase migration commands parameters moved to methods ([#34007](https://github.com/laravel/framework/pull/34007), [8b35c8e](https://github.com/laravel/framework/commit/8b35c8e6ba5879e71fd81fd03b5687ee2b46c55a), [256f71c](https://github.com/laravel/framework/commit/256f71c1f81da2d4bb3e327b18389ac43fa97a72))
14+
15+
### Changed
16+
- allow to reset forced scheme and root-url in UrlGenerator ([#34039](https://github.com/laravel/framework/pull/34039))
17+
- Updating the make commands to use a custom views path ([#34060](https://github.com/laravel/framework/pull/34060), [b593c62](https://github.com/laravel/framework/commit/b593c6242942623fcc12638d0390da7c58dbbb11))
18+
- Using "public static property" in View Component causes an error ([#34058](https://github.com/laravel/framework/pull/34058))
19+
- Changed postgres processor ([#34055](https://github.com/laravel/framework/pull/34055))
420

521

622
## [v7.26.1 (2020-08-27)](https://github.com/laravel/framework/compare/v7.26.0...v7.26.1)

src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ public function joiningTableSegment()
682682
*/
683683
public function touches($relation)
684684
{
685-
return in_array($relation, $this->touches);
685+
return in_array($relation, $this->getTouchedRelations());
686686
}
687687

688688
/**
@@ -692,7 +692,7 @@ public function touches($relation)
692692
*/
693693
public function touchOwners()
694694
{
695-
foreach ($this->touches as $relation) {
695+
foreach ($this->getTouchedRelations() as $relation) {
696696
$this->$relation()->touch();
697697

698698
if ($this->$relation instanceof self) {

src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ trait InteractsWithConsole
2222
*/
2323
public $expectedOutput = [];
2424

25+
/**
26+
* All of the expected ouput tables.
27+
*
28+
* @var array
29+
*/
30+
public $expectedTables = [];
31+
2532
/**
2633
* All of the expected questions.
2734
*

src/Illuminate/Testing/PendingCommand.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
use Illuminate\Console\OutputStyle;
66
use Illuminate\Contracts\Console\Kernel;
77
use Illuminate\Contracts\Container\Container;
8+
use Illuminate\Contracts\Support\Arrayable;
89
use Illuminate\Support\Arr;
910
use Mockery;
1011
use Mockery\Exception\NoMatchingExpectationException;
1112
use PHPUnit\Framework\TestCase as PHPUnitTestCase;
13+
use Symfony\Component\Console\Helper\Table;
1214
use Symfony\Component\Console\Input\ArrayInput;
1315
use Symfony\Component\Console\Output\BufferedOutput;
1416

@@ -131,6 +133,27 @@ public function expectsOutput($output)
131133
return $this;
132134
}
133135

136+
/**
137+
* Specify a table that should be printed when the command runs.
138+
*
139+
* @param array $headers
140+
* @param \Illuminate\Contracts\Support\Arrayable|array $rows
141+
* @param string $tableStyle
142+
* @param array $columnStyles
143+
* @return $this
144+
*/
145+
public function expectsTable($headers, $rows, $tableStyle = 'default', array $columnStyles = [])
146+
{
147+
$this->test->expectedTables[] = [
148+
'headers' => (array) $headers,
149+
'rows' => $rows instanceof Arrayable ? $rows->toArray() : $rows,
150+
'tableStyle' => $tableStyle,
151+
'columnStyles' => $columnStyles,
152+
];
153+
154+
return $this;
155+
}
156+
134157
/**
135158
* Assert that the command has the given exit code.
136159
*
@@ -264,6 +287,8 @@ private function createABufferedOutputMock()
264287
->shouldAllowMockingProtectedMethods()
265288
->shouldIgnoreMissing();
266289

290+
$this->applyTableOutputExpectations($mock);
291+
267292
foreach ($this->test->expectedOutput as $i => $output) {
268293
$mock->shouldReceive('doWrite')
269294
->once()
@@ -277,6 +302,36 @@ private function createABufferedOutputMock()
277302
return $mock;
278303
}
279304

305+
/**
306+
* Apply the output table expectations to the mock.
307+
*
308+
* @param \Mockery\MockInterface $mock
309+
* @return void
310+
*/
311+
private function applyTableOutputExpectations($mock)
312+
{
313+
foreach ($this->test->expectedTables as $consoleTable) {
314+
$table = (new Table($output = new BufferedOutput))
315+
->setHeaders($consoleTable['headers'])
316+
->setRows($consoleTable['rows'])
317+
->setStyle($consoleTable['tableStyle']);
318+
319+
foreach ($consoleTable['columnStyles'] as $columnIndex => $columnStyle) {
320+
$table->setColumnStyle($columnIndex, $columnStyle);
321+
}
322+
323+
$table->render();
324+
325+
$lines = array_filter(
326+
preg_split("/\n/", $output->fetch())
327+
);
328+
329+
foreach ($lines as $line) {
330+
$this->expectsOutput($line);
331+
}
332+
}
333+
}
334+
280335
/**
281336
* Handle the object's destruction.
282337
*

0 commit comments

Comments
 (0)