language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | laravel | framework | e2518c79d793094533bc97a522c32922ada17d8f.json | Simplify mock returns. | tests/Queue/QueueSqsQueueTest.php | @@ -72,7 +72,7 @@ public function testPopProperlyPopsJobOffOfSqs()
{
$queue = $this->getMockBuilder(SqsQueue::class)->setMethods(['getQueue'])->setConstructorArgs([$this->sqs, $this->queueName, $this->account])->getMock();
$queue->setContainer(m::mock(Container::class));
- $queue->expects($this->once())->method('getQueue')->with($this->queueName)->will($this->returnValue($this->queueUrl));
+ $queue->expects($this->once())->method('getQueue')->with($this->queueName)->willReturn($this->queueUrl);
$this->sqs->shouldReceive('receiveMessage')->once()->with(['QueueUrl' => $this->queueUrl, 'AttributeNames' => ['ApproximateReceiveCount']])->andReturn($this->mockedReceiveMessageResponseModel);
$result = $queue->pop($this->queueName);
$this->assertInstanceOf(SqsJob::class, $result);
@@ -82,7 +82,7 @@ public function testPopProperlyHandlesEmptyMessage()
{
$queue = $this->getMockBuilder(SqsQueue::class)->setMethods(['getQueue'])->setConstructorArgs([$this->sqs, $this->queueName, $this->account])->getMock();
$queue->setContainer(m::mock(Container::class));
- $queue->expects($this->once())->method('getQueue')->with($this->queueName)->will($this->returnValue($this->queueUrl));
+ $queue->expects($this->once())->method('getQueue')->with($this->queueName)->willReturn($this->queueUrl);
$this->sqs->shouldReceive('receiveMessage')->once()->with(['QueueUrl' => $this->queueUrl, 'AttributeNames' => ['ApproximateReceiveCount']])->andReturn($this->mockedReceiveEmptyMessageResponseModel);
$result = $queue->pop($this->queueName);
$this->assertNull($result);
@@ -92,9 +92,9 @@ public function testDelayedPushWithDateTimeProperlyPushesJobOntoSqs()
{
$now = Carbon::now();
$queue = $this->getMockBuilder(SqsQueue::class)->setMethods(['createPayload', 'secondsUntil', 'getQueue'])->setConstructorArgs([$this->sqs, $this->queueName, $this->account])->getMock();
- $queue->expects($this->once())->method('createPayload')->with($this->mockedJob, $this->queueName, $this->mockedData)->will($this->returnValue($this->mockedPayload));
- $queue->expects($this->once())->method('secondsUntil')->with($now)->will($this->returnValue(5));
- $queue->expects($this->once())->method('getQueue')->with($this->queueName)->will($this->returnValue($this->queueUrl));
+ $queue->expects($this->once())->method('createPayload')->with($this->mockedJob, $this->queueName, $this->mockedData)->willReturn($this->mockedPayload);
+ $queue->expects($this->once())->method('secondsUntil')->with($now)->willReturn(5);
+ $queue->expects($this->once())->method('getQueue')->with($this->queueName)->willReturn($this->queueUrl);
$this->sqs->shouldReceive('sendMessage')->once()->with(['QueueUrl' => $this->queueUrl, 'MessageBody' => $this->mockedPayload, 'DelaySeconds' => 5])->andReturn($this->mockedSendMessageResponseModel);
$id = $queue->later($now->addSeconds(5), $this->mockedJob, $this->mockedData, $this->queueName);
$this->assertEquals($this->mockedMessageId, $id);
@@ -103,9 +103,9 @@ public function testDelayedPushWithDateTimeProperlyPushesJobOntoSqs()
public function testDelayedPushProperlyPushesJobOntoSqs()
{
$queue = $this->getMockBuilder(SqsQueue::class)->setMethods(['createPayload', 'secondsUntil', 'getQueue'])->setConstructorArgs([$this->sqs, $this->queueName, $this->account])->getMock();
- $queue->expects($this->once())->method('createPayload')->with($this->mockedJob, $this->queueName, $this->mockedData)->will($this->returnValue($this->mockedPayload));
- $queue->expects($this->once())->method('secondsUntil')->with($this->mockedDelay)->will($this->returnValue($this->mockedDelay));
- $queue->expects($this->once())->method('getQueue')->with($this->queueName)->will($this->returnValue($this->queueUrl));
+ $queue->expects($this->once())->method('createPayload')->with($this->mockedJob, $this->queueName, $this->mockedData)->willReturn($this->mockedPayload);
+ $queue->expects($this->once())->method('secondsUntil')->with($this->mockedDelay)->willReturn($this->mockedDelay);
+ $queue->expects($this->once())->method('getQueue')->with($this->queueName)->willReturn($this->queueUrl);
$this->sqs->shouldReceive('sendMessage')->once()->with(['QueueUrl' => $this->queueUrl, 'MessageBody' => $this->mockedPayload, 'DelaySeconds' => $this->mockedDelay])->andReturn($this->mockedSendMessageResponseModel);
$id = $queue->later($this->mockedDelay, $this->mockedJob, $this->mockedData, $this->queueName);
$this->assertEquals($this->mockedMessageId, $id);
@@ -114,8 +114,8 @@ public function testDelayedPushProperlyPushesJobOntoSqs()
public function testPushProperlyPushesJobOntoSqs()
{
$queue = $this->getMockBuilder(SqsQueue::class)->setMethods(['createPayload', 'getQueue'])->setConstructorArgs([$this->sqs, $this->queueName, $this->account])->getMock();
- $queue->expects($this->once())->method('createPayload')->with($this->mockedJob, $this->queueName, $this->mockedData)->will($this->returnValue($this->mockedPayload));
- $queue->expects($this->once())->method('getQueue')->with($this->queueName)->will($this->returnValue($this->queueUrl));
+ $queue->expects($this->once())->method('createPayload')->with($this->mockedJob, $this->queueName, $this->mockedData)->willReturn($this->mockedPayload);
+ $queue->expects($this->once())->method('getQueue')->with($this->queueName)->willReturn($this->queueUrl);
$this->sqs->shouldReceive('sendMessage')->once()->with(['QueueUrl' => $this->queueUrl, 'MessageBody' => $this->mockedPayload])->andReturn($this->mockedSendMessageResponseModel);
$id = $queue->push($this->mockedJob, $this->mockedData, $this->queueName);
$this->assertEquals($this->mockedMessageId, $id);
@@ -124,7 +124,7 @@ public function testPushProperlyPushesJobOntoSqs()
public function testSizeProperlyReadsSqsQueueSize()
{
$queue = $this->getMockBuilder(SqsQueue::class)->setMethods(['getQueue'])->setConstructorArgs([$this->sqs, $this->queueName, $this->account])->getMock();
- $queue->expects($this->once())->method('getQueue')->with($this->queueName)->will($this->returnValue($this->queueUrl));
+ $queue->expects($this->once())->method('getQueue')->with($this->queueName)->willReturn($this->queueUrl);
$this->sqs->shouldReceive('getQueueAttributes')->once()->with(['QueueUrl' => $this->queueUrl, 'AttributeNames' => ['ApproximateNumberOfMessages']])->andReturn($this->mockedQueueAttributesResponseModel);
$size = $queue->size($this->queueName);
$this->assertEquals($size, 1); | true |
Other | laravel | framework | e2518c79d793094533bc97a522c32922ada17d8f.json | Simplify mock returns. | tests/Support/SupportCollectionTest.php | @@ -218,7 +218,7 @@ public function testJsonSerializeCallsToArrayOrJsonSerializeOnEachItemInCollecti
public function testToJsonEncodesTheJsonSerializeResult()
{
$c = $this->getMockBuilder(Collection::class)->setMethods(['jsonSerialize'])->getMock();
- $c->expects($this->once())->method('jsonSerialize')->will($this->returnValue('foo'));
+ $c->expects($this->once())->method('jsonSerialize')->willReturn('foo');
$results = $c->toJson();
$this->assertJsonStringEqualsJsonString(json_encode('foo'), $results);
@@ -227,7 +227,7 @@ public function testToJsonEncodesTheJsonSerializeResult()
public function testCastingToStringJsonEncodesTheToArrayResult()
{
$c = $this->getMockBuilder(Collection::class)->setMethods(['jsonSerialize'])->getMock();
- $c->expects($this->once())->method('jsonSerialize')->will($this->returnValue('foo'));
+ $c->expects($this->once())->method('jsonSerialize')->willReturn('foo');
$this->assertJsonStringEqualsJsonString(json_encode('foo'), (string) $c);
} | true |
Other | laravel | framework | e2518c79d793094533bc97a522c32922ada17d8f.json | Simplify mock returns. | tests/Support/SupportFluentTest.php | @@ -108,7 +108,7 @@ public function testToArrayReturnsAttribute()
public function testToJsonEncodesTheToArrayResult()
{
$fluent = $this->getMockBuilder(Fluent::class)->setMethods(['toArray'])->getMock();
- $fluent->expects($this->once())->method('toArray')->will($this->returnValue('foo'));
+ $fluent->expects($this->once())->method('toArray')->willReturn('foo');
$results = $fluent->toJson();
$this->assertJsonStringEqualsJsonString(json_encode('foo'), $results); | true |
Other | laravel | framework | e2518c79d793094533bc97a522c32922ada17d8f.json | Simplify mock returns. | tests/Translation/TranslationTranslatorTest.php | @@ -19,19 +19,19 @@ protected function tearDown(): void
public function testHasMethodReturnsFalseWhenReturnedTranslationIsNull()
{
$t = $this->getMockBuilder(Translator::class)->setMethods(['get'])->setConstructorArgs([$this->getLoader(), 'en'])->getMock();
- $t->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo([]), $this->equalTo('bar'))->will($this->returnValue('foo'));
+ $t->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo([]), $this->equalTo('bar'))->willReturn('foo');
$this->assertFalse($t->has('foo', 'bar'));
$t = $this->getMockBuilder(Translator::class)->setMethods(['get'])->setConstructorArgs([$this->getLoader(), 'en', 'sp'])->getMock();
- $t->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo([]), $this->equalTo('bar'))->will($this->returnValue('bar'));
+ $t->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo([]), $this->equalTo('bar'))->willReturn('bar');
$this->assertTrue($t->has('foo', 'bar'));
$t = $this->getMockBuilder(Translator::class)->setMethods(['get'])->setConstructorArgs([$this->getLoader(), 'en'])->getMock();
- $t->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo([]), $this->equalTo('bar'), false)->will($this->returnValue('bar'));
+ $t->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo([]), $this->equalTo('bar'), false)->willReturn('bar');
$this->assertTrue($t->hasForLocale('foo', 'bar'));
$t = $this->getMockBuilder(Translator::class)->setMethods(['get'])->setConstructorArgs([$this->getLoader(), 'en'])->getMock();
- $t->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo([]), $this->equalTo('bar'), false)->will($this->returnValue('foo'));
+ $t->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo([]), $this->equalTo('bar'), false)->willReturn('foo');
$this->assertFalse($t->hasForLocale('foo', 'bar'));
$t = new Translator($this->getLoader(), 'en');
@@ -115,7 +115,7 @@ public function testGetMethodProperlyLoadsAndRetrievesItemForGlobalNamespace()
public function testChoiceMethodProperlyLoadsAndRetrievesItem()
{
$t = $this->getMockBuilder(Translator::class)->setMethods(['get'])->setConstructorArgs([$this->getLoader(), 'en'])->getMock();
- $t->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo(['replace']), $this->equalTo('en'))->will($this->returnValue('line'));
+ $t->expects($this->once())->method('get')->with($this->equalTo('foo'), $this->equalTo(['replace']), $this->equalTo('en'))->willReturn('line');
$t->setSelector($selector = m::mock(MessageSelector::class));
$selector->shouldReceive('choose')->once()->with('line', 10, 'en')->andReturn('choiced');
@@ -125,7 +125,7 @@ public function testChoiceMethodProperlyLoadsAndRetrievesItem()
public function testChoiceMethodProperlyCountsCollectionsAndLoadsAndRetrievesItem()
{
$t = $this->getMockBuilder(Translator::class)->setMethods(['get'])->setConstructorArgs([$this->getLoader(), 'en'])->getMock();
- $t->expects($this->exactly(2))->method('get')->with($this->equalTo('foo'), $this->equalTo(['replace']), $this->equalTo('en'))->will($this->returnValue('line'));
+ $t->expects($this->exactly(2))->method('get')->with($this->equalTo('foo'), $this->equalTo(['replace']), $this->equalTo('en'))->willReturn('line');
$t->setSelector($selector = m::mock(MessageSelector::class));
$selector->shouldReceive('choose')->twice()->with('line', 3, 'en')->andReturn('choiced');
| true |
Other | laravel | framework | e2518c79d793094533bc97a522c32922ada17d8f.json | Simplify mock returns. | tests/Validation/ValidationValidatorTest.php | @@ -1098,9 +1098,9 @@ public function testGreaterThan()
$this->assertTrue($v->fails());
$fileOne = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $fileOne->expects($this->any())->method('getSize')->will($this->returnValue(5472));
+ $fileOne->expects($this->any())->method('getSize')->willReturn(5472);
$fileTwo = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $fileTwo->expects($this->any())->method('getSize')->will($this->returnValue(3151));
+ $fileTwo->expects($this->any())->method('getSize')->willReturn(3151);
$v = new Validator($trans, ['lhs' => $fileOne, 'rhs' => $fileTwo], ['lhs' => 'gt:rhs']);
$this->assertTrue($v->passes());
@@ -1127,9 +1127,9 @@ public function testLessThan()
$this->assertTrue($v->passes());
$fileOne = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $fileOne->expects($this->any())->method('getSize')->will($this->returnValue(5472));
+ $fileOne->expects($this->any())->method('getSize')->willReturn(5472);
$fileTwo = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $fileTwo->expects($this->any())->method('getSize')->will($this->returnValue(3151));
+ $fileTwo->expects($this->any())->method('getSize')->willReturn(3151);
$v = new Validator($trans, ['lhs' => $fileOne, 'rhs' => $fileTwo], ['lhs' => 'lt:rhs']);
$this->assertTrue($v->fails());
@@ -1156,9 +1156,9 @@ public function testGreaterThanOrEqual()
$this->assertTrue($v->fails());
$fileOne = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $fileOne->expects($this->any())->method('getSize')->will($this->returnValue(5472));
+ $fileOne->expects($this->any())->method('getSize')->willReturn(5472);
$fileTwo = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $fileTwo->expects($this->any())->method('getSize')->will($this->returnValue(5472));
+ $fileTwo->expects($this->any())->method('getSize')->willReturn(5472);
$v = new Validator($trans, ['lhs' => $fileOne, 'rhs' => $fileTwo], ['lhs' => 'gte:rhs']);
$this->assertTrue($v->passes());
@@ -1185,9 +1185,9 @@ public function testLessThanOrEqual()
$this->assertTrue($v->passes());
$fileOne = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $fileOne->expects($this->any())->method('getSize')->will($this->returnValue(5472));
+ $fileOne->expects($this->any())->method('getSize')->willReturn(5472);
$fileTwo = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $fileTwo->expects($this->any())->method('getSize')->will($this->returnValue(5472));
+ $fileTwo->expects($this->any())->method('getSize')->willReturn(5472);
$v = new Validator($trans, ['lhs' => $fileOne, 'rhs' => $fileTwo], ['lhs' => 'lte:rhs']);
$this->assertTrue($v->passes());
@@ -1488,12 +1488,12 @@ public function testValidateSize()
$this->assertFalse($v->passes());
$file = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $file->expects($this->any())->method('getSize')->will($this->returnValue(3072));
+ $file->expects($this->any())->method('getSize')->willReturn(3072);
$v = new Validator($trans, ['photo' => $file], ['photo' => 'Size:3']);
$this->assertTrue($v->passes());
$file = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $file->expects($this->any())->method('getSize')->will($this->returnValue(4072));
+ $file->expects($this->any())->method('getSize')->willReturn(4072);
$v = new Validator($trans, ['photo' => $file], ['photo' => 'Size:3']);
$this->assertFalse($v->passes());
}
@@ -1526,12 +1526,12 @@ public function testValidateBetween()
$this->assertFalse($v->passes());
$file = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $file->expects($this->any())->method('getSize')->will($this->returnValue(3072));
+ $file->expects($this->any())->method('getSize')->willReturn(3072);
$v = new Validator($trans, ['photo' => $file], ['photo' => 'Between:1,5']);
$this->assertTrue($v->passes());
$file = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $file->expects($this->any())->method('getSize')->will($this->returnValue(4072));
+ $file->expects($this->any())->method('getSize')->willReturn(4072);
$v = new Validator($trans, ['photo' => $file], ['photo' => 'Between:1,2']);
$this->assertFalse($v->passes());
}
@@ -1558,12 +1558,12 @@ public function testValidateMin()
$this->assertFalse($v->passes());
$file = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $file->expects($this->any())->method('getSize')->will($this->returnValue(3072));
+ $file->expects($this->any())->method('getSize')->willReturn(3072);
$v = new Validator($trans, ['photo' => $file], ['photo' => 'Min:2']);
$this->assertTrue($v->passes());
$file = $this->getMockBuilder(File::class)->setMethods(['getSize'])->setConstructorArgs([__FILE__, false])->getMock();
- $file->expects($this->any())->method('getSize')->will($this->returnValue(4072));
+ $file->expects($this->any())->method('getSize')->willReturn(4072);
$v = new Validator($trans, ['photo' => $file], ['photo' => 'Min:10']);
$this->assertFalse($v->passes());
}
@@ -1590,19 +1590,19 @@ public function testValidateMax()
$this->assertFalse($v->passes());
$file = $this->getMockBuilder(UploadedFile::class)->setMethods(['isValid', 'getSize'])->setConstructorArgs([__FILE__, basename(__FILE__)])->getMock();
- $file->expects($this->any())->method('isValid')->will($this->returnValue(true));
- $file->expects($this->at(1))->method('getSize')->will($this->returnValue(3072));
+ $file->expects($this->any())->method('isValid')->willReturn(true);
+ $file->expects($this->at(1))->method('getSize')->willReturn(3072);
$v = new Validator($trans, ['photo' => $file], ['photo' => 'Max:10']);
$this->assertTrue($v->passes());
$file = $this->getMockBuilder(UploadedFile::class)->setMethods(['isValid', 'getSize'])->setConstructorArgs([__FILE__, basename(__FILE__)])->getMock();
- $file->expects($this->at(0))->method('isValid')->will($this->returnValue(true));
- $file->expects($this->at(1))->method('getSize')->will($this->returnValue(4072));
+ $file->expects($this->at(0))->method('isValid')->willReturn(true);
+ $file->expects($this->at(1))->method('getSize')->willReturn(4072);
$v = new Validator($trans, ['photo' => $file], ['photo' => 'Max:2']);
$this->assertFalse($v->passes());
$file = $this->getMockBuilder(UploadedFile::class)->setMethods(['isValid'])->setConstructorArgs([__FILE__, basename(__FILE__)])->getMock();
- $file->expects($this->any())->method('isValid')->will($this->returnValue(false));
+ $file->expects($this->any())->method('isValid')->willReturn(false);
$v = new Validator($trans, ['photo' => $file], ['photo' => 'Max:10']);
$this->assertFalse($v->passes());
}
@@ -1622,8 +1622,8 @@ public function testProperMessagesAreReturnedForSizes()
$this->assertEquals('string', $v->messages()->first('name'));
$file = $this->getMockBuilder(UploadedFile::class)->setMethods(['getSize', 'isValid'])->setConstructorArgs([__FILE__, false])->getMock();
- $file->expects($this->any())->method('getSize')->will($this->returnValue(4072));
- $file->expects($this->any())->method('isValid')->will($this->returnValue(true));
+ $file->expects($this->any())->method('getSize')->willReturn(4072);
+ $file->expects($this->any())->method('isValid')->willReturn(true);
$v = new Validator($trans, ['photo' => $file], ['photo' => 'Max:3']);
$this->assertFalse($v->passes());
$v->messages()->setFormat(':message');
@@ -1653,11 +1653,11 @@ public function testValidateGtPlaceHolderIsReplacedProperly()
$this->assertEquals(5, $v->messages()->first('items'));
$file = $this->getMockBuilder(UploadedFile::class)->setMethods(['getSize', 'isValid'])->setConstructorArgs([__FILE__, false])->getMock();
- $file->expects($this->any())->method('getSize')->will($this->returnValue(4072));
- $file->expects($this->any())->method('isValid')->will($this->returnValue(true));
+ $file->expects($this->any())->method('getSize')->willReturn(4072);
+ $file->expects($this->any())->method('isValid')->willReturn(true);
$biggerFile = $this->getMockBuilder(UploadedFile::class)->setMethods(['getSize', 'isValid'])->setConstructorArgs([__FILE__, false])->getMock();
- $biggerFile->expects($this->any())->method('getSize')->will($this->returnValue(5120));
- $biggerFile->expects($this->any())->method('isValid')->will($this->returnValue(true));
+ $biggerFile->expects($this->any())->method('getSize')->willReturn(5120);
+ $biggerFile->expects($this->any())->method('isValid')->willReturn(true);
$v = new Validator($trans, ['photo' => $file, 'bigger' => $biggerFile], ['photo' => 'file|gt:bigger']);
$this->assertFalse($v->passes());
$this->assertEquals(5, $v->messages()->first('photo'));
@@ -1690,11 +1690,11 @@ public function testValidateLtPlaceHolderIsReplacedProperly()
$this->assertEquals(2, $v->messages()->first('items'));
$file = $this->getMockBuilder(UploadedFile::class)->setMethods(['getSize', 'isValid'])->setConstructorArgs([__FILE__, false])->getMock();
- $file->expects($this->any())->method('getSize')->will($this->returnValue(4072));
- $file->expects($this->any())->method('isValid')->will($this->returnValue(true));
+ $file->expects($this->any())->method('getSize')->willReturn(4072);
+ $file->expects($this->any())->method('isValid')->willReturn(true);
$smallerFile = $this->getMockBuilder(UploadedFile::class)->setMethods(['getSize', 'isValid'])->setConstructorArgs([__FILE__, false])->getMock();
- $smallerFile->expects($this->any())->method('getSize')->will($this->returnValue(2048));
- $smallerFile->expects($this->any())->method('isValid')->will($this->returnValue(true));
+ $smallerFile->expects($this->any())->method('getSize')->willReturn(2048);
+ $smallerFile->expects($this->any())->method('isValid')->willReturn(true);
$v = new Validator($trans, ['photo' => $file, 'smaller' => $smallerFile], ['photo' => 'file|lt:smaller']);
$this->assertFalse($v->passes());
$this->assertEquals(2, $v->messages()->first('photo'));
@@ -1727,11 +1727,11 @@ public function testValidateGtePlaceHolderIsReplacedProperly()
$this->assertEquals(5, $v->messages()->first('items'));
$file = $this->getMockBuilder(UploadedFile::class)->setMethods(['getSize', 'isValid'])->setConstructorArgs([__FILE__, false])->getMock();
- $file->expects($this->any())->method('getSize')->will($this->returnValue(4072));
- $file->expects($this->any())->method('isValid')->will($this->returnValue(true));
+ $file->expects($this->any())->method('getSize')->willReturn(4072);
+ $file->expects($this->any())->method('isValid')->willReturn(true);
$biggerFile = $this->getMockBuilder(UploadedFile::class)->setMethods(['getSize', 'isValid'])->setConstructorArgs([__FILE__, false])->getMock();
- $biggerFile->expects($this->any())->method('getSize')->will($this->returnValue(5120));
- $biggerFile->expects($this->any())->method('isValid')->will($this->returnValue(true));
+ $biggerFile->expects($this->any())->method('getSize')->willReturn(5120);
+ $biggerFile->expects($this->any())->method('isValid')->willReturn(true);
$v = new Validator($trans, ['photo' => $file, 'bigger' => $biggerFile], ['photo' => 'file|gte:bigger']);
$this->assertFalse($v->passes());
$this->assertEquals(5, $v->messages()->first('photo'));
@@ -1764,11 +1764,11 @@ public function testValidateLtePlaceHolderIsReplacedProperly()
$this->assertEquals(2, $v->messages()->first('items'));
$file = $this->getMockBuilder(UploadedFile::class)->setMethods(['getSize', 'isValid'])->setConstructorArgs([__FILE__, false])->getMock();
- $file->expects($this->any())->method('getSize')->will($this->returnValue(4072));
- $file->expects($this->any())->method('isValid')->will($this->returnValue(true));
+ $file->expects($this->any())->method('getSize')->willReturn(4072);
+ $file->expects($this->any())->method('isValid')->willReturn(true);
$smallerFile = $this->getMockBuilder(UploadedFile::class)->setMethods(['getSize', 'isValid'])->setConstructorArgs([__FILE__, false])->getMock();
- $smallerFile->expects($this->any())->method('getSize')->will($this->returnValue(2048));
- $smallerFile->expects($this->any())->method('isValid')->will($this->returnValue(true));
+ $smallerFile->expects($this->any())->method('getSize')->willReturn(2048);
+ $smallerFile->expects($this->any())->method('isValid')->willReturn(true);
$v = new Validator($trans, ['photo' => $file, 'smaller' => $smallerFile], ['photo' => 'file|lte:smaller']);
$this->assertFalse($v->passes());
$this->assertEquals(2, $v->messages()->first('photo'));
@@ -2402,44 +2402,44 @@ public function testValidateImage()
$uploadedFile = [__FILE__, '', null, null, null, true];
$file = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
- $file->expects($this->any())->method('guessExtension')->will($this->returnValue('php'));
- $file->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('php'));
+ $file->expects($this->any())->method('guessExtension')->willReturn('php');
+ $file->expects($this->any())->method('getClientOriginalExtension')->willReturn('php');
$v = new Validator($trans, ['x' => $file], ['x' => 'Image']);
$this->assertFalse($v->passes());
$file2 = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
- $file2->expects($this->any())->method('guessExtension')->will($this->returnValue('jpeg'));
- $file2->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('jpeg'));
+ $file2->expects($this->any())->method('guessExtension')->willReturn('jpeg');
+ $file2->expects($this->any())->method('getClientOriginalExtension')->willReturn('jpeg');
$v = new Validator($trans, ['x' => $file2], ['x' => 'Image']);
$this->assertTrue($v->passes());
$file3 = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
- $file3->expects($this->any())->method('guessExtension')->will($this->returnValue('gif'));
- $file3->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('gif'));
+ $file3->expects($this->any())->method('guessExtension')->willReturn('gif');
+ $file3->expects($this->any())->method('getClientOriginalExtension')->willReturn('gif');
$v = new Validator($trans, ['x' => $file3], ['x' => 'Image']);
$this->assertTrue($v->passes());
$file4 = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
- $file4->expects($this->any())->method('guessExtension')->will($this->returnValue('bmp'));
- $file4->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('bmp'));
+ $file4->expects($this->any())->method('guessExtension')->willReturn('bmp');
+ $file4->expects($this->any())->method('getClientOriginalExtension')->willReturn('bmp');
$v = new Validator($trans, ['x' => $file4], ['x' => 'Image']);
$this->assertTrue($v->passes());
$file5 = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
- $file5->expects($this->any())->method('guessExtension')->will($this->returnValue('png'));
- $file5->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('png'));
+ $file5->expects($this->any())->method('guessExtension')->willReturn('png');
+ $file5->expects($this->any())->method('getClientOriginalExtension')->willReturn('png');
$v = new Validator($trans, ['x' => $file5], ['x' => 'Image']);
$this->assertTrue($v->passes());
$file6 = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
- $file6->expects($this->any())->method('guessExtension')->will($this->returnValue('svg'));
- $file6->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('svg'));
+ $file6->expects($this->any())->method('guessExtension')->willReturn('svg');
+ $file6->expects($this->any())->method('getClientOriginalExtension')->willReturn('svg');
$v = new Validator($trans, ['x' => $file6], ['x' => 'Image']);
$this->assertTrue($v->passes());
$file7 = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
- $file7->expects($this->any())->method('guessExtension')->will($this->returnValue('webp'));
- $file7->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('webp'));
+ $file7->expects($this->any())->method('guessExtension')->willReturn('webp');
+ $file7->expects($this->any())->method('getClientOriginalExtension')->willReturn('webp');
$v = new Validator($trans, ['x' => $file7], ['x' => 'Image']);
$this->assertTrue($v->passes());
}
@@ -2450,8 +2450,8 @@ public function testValidateImageDoesNotAllowPhpExtensionsOnImageMime()
$uploadedFile = [__FILE__, '', null, null, null, true];
$file = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
- $file->expects($this->any())->method('guessExtension')->will($this->returnValue('jpeg'));
- $file->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('php'));
+ $file->expects($this->any())->method('guessExtension')->willReturn('jpeg');
+ $file->expects($this->any())->method('getClientOriginalExtension')->willReturn('php');
$v = new Validator($trans, ['x' => $file], ['x' => 'Image']);
$this->assertFalse($v->passes());
}
@@ -2547,8 +2547,8 @@ public function testValidatePhpMimetypes()
$uploadedFile = [__DIR__.'/ValidationRuleTest.php', '', null, null, null, true];
$file = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
- $file->expects($this->any())->method('guessExtension')->will($this->returnValue('rtf'));
- $file->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('rtf'));
+ $file->expects($this->any())->method('guessExtension')->willReturn('rtf');
+ $file->expects($this->any())->method('getClientOriginalExtension')->willReturn('rtf');
$v = new Validator($trans, ['x' => $file], ['x' => 'mimetypes:text/*']);
$this->assertTrue($v->passes());
@@ -2560,14 +2560,14 @@ public function testValidateMime()
$uploadedFile = [__FILE__, '', null, null, null, true];
$file = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
- $file->expects($this->any())->method('guessExtension')->will($this->returnValue('pdf'));
- $file->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('pdf'));
+ $file->expects($this->any())->method('guessExtension')->willReturn('pdf');
+ $file->expects($this->any())->method('getClientOriginalExtension')->willReturn('pdf');
$v = new Validator($trans, ['x' => $file], ['x' => 'mimes:pdf']);
$this->assertTrue($v->passes());
$file2 = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'isValid'])->setConstructorArgs($uploadedFile)->getMock();
- $file2->expects($this->any())->method('guessExtension')->will($this->returnValue('pdf'));
- $file2->expects($this->any())->method('isValid')->will($this->returnValue(false));
+ $file2->expects($this->any())->method('guessExtension')->willReturn('pdf');
+ $file2->expects($this->any())->method('isValid')->willReturn(false);
$v = new Validator($trans, ['x' => $file2], ['x' => 'mimes:pdf']);
$this->assertFalse($v->passes());
}
@@ -2578,14 +2578,14 @@ public function testValidateMimeEnforcesPhpCheck()
$uploadedFile = [__FILE__, '', null, null, null, true];
$file = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
- $file->expects($this->any())->method('guessExtension')->will($this->returnValue('pdf'));
- $file->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('php'));
+ $file->expects($this->any())->method('guessExtension')->willReturn('pdf');
+ $file->expects($this->any())->method('getClientOriginalExtension')->willReturn('php');
$v = new Validator($trans, ['x' => $file], ['x' => 'mimes:pdf']);
$this->assertFalse($v->passes());
$file2 = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
- $file2->expects($this->any())->method('guessExtension')->will($this->returnValue('php'));
- $file2->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('php'));
+ $file2->expects($this->any())->method('guessExtension')->willReturn('php');
+ $file2->expects($this->any())->method('getClientOriginalExtension')->willReturn('php');
$v = new Validator($trans, ['x' => $file2], ['x' => 'mimes:pdf,php']);
$this->assertTrue($v->passes());
} | true |
Other | laravel | framework | 637d17ce60082009e0740c02fbf1f8964cf1edb8.json | Fix 2 tests. | tests/Foundation/FoundationAuthorizesRequestsTraitTest.php | @@ -139,14 +139,14 @@ public function update()
return true;
}
- public function test_policy_method_may_be_guessed_passing_model_instance()
+ public function testPolicyMethodMayBeGuessedPassingModelInstance()
{
$_SERVER['_test.authorizes.trait.policy'] = true;
return true;
}
- public function test_policy_method_may_be_guessed_passing_class_name()
+ public function testPolicyMethodMayBeGuessedPassingClassName()
{
$_SERVER['_test.authorizes.trait.policy'] = true;
| false |
Other | laravel | framework | cc1c9ad549b44b0550278f1a4af91316d614d63b.json | Remove useless namespace prefix. | tests/Integration/Support/ManagerTest.php | @@ -4,13 +4,14 @@
use InvalidArgumentException;
use Orchestra\Testbench\TestCase;
+use Illuminate\Tests\Integration\Support\Fixtures\NullableManager;
class ManagerTest extends TestCase
{
public function testDefaultDriverCannotBeNull()
{
$this->expectException(InvalidArgumentException::class);
- (new Fixtures\NullableManager($this->app))->driver();
+ (new NullableManager($this->app))->driver();
}
} | false |
Other | laravel | framework | 7bdd8007a2785330f9c60955676707d45d0ab5ef.json | Close mockery in the teardown method | tests/Redis/RedisManagerExtensionTest.php | @@ -45,6 +45,11 @@ protected function setUp(): void
});
}
+ protected function tearDown(): void
+ {
+ m::close();
+ }
+
public function test_using_custom_redis_connector_with_single_redis_instance()
{
$this->assertEquals( | false |
Other | laravel | framework | 88ec20dbaac61453f1f48e4013af3b3d96ad0729.json | Remove new password validation from broker
These changes remove all hardcoded valdation from the PasswordBroker. The reason for this is because this is a hardcoded constraint in validation and thus limits people from building password reset forms with their specific flow. The validation is already done within the ResetsPassword trait and is only duplicated in the Broker. The Broker also seems like the wrong place to do this as it only facilitates the retrieval of the user and the token validation (which is still the correct place for these two).
This also allows us to remove the https://github.com/laravel/laravel/blob/develop/resources/lang/en/passwords.php#L16 language line.
See https://github.com/laravel/framework/pull/25957#issuecomment-519662680 | src/Illuminate/Auth/Passwords/PasswordBroker.php | @@ -25,22 +25,14 @@ class PasswordBroker implements PasswordBrokerContract
*/
protected $users;
- /**
- * The custom password validator callback.
- *
- * @var \Closure
- */
- protected $passwordValidator;
-
/**
* Create a new password broker instance.
*
* @param \Illuminate\Auth\Passwords\TokenRepositoryInterface $tokens
* @param \Illuminate\Contracts\Auth\UserProvider $users
* @return void
*/
- public function __construct(TokenRepositoryInterface $tokens,
- UserProvider $users)
+ public function __construct(TokenRepositoryInterface $tokens, UserProvider $users)
{
$this->users = $users;
$this->tokens = $tokens;
@@ -82,11 +74,11 @@ public function sendResetLink(array $credentials)
*/
public function reset(array $credentials, Closure $callback)
{
+ $user = $this->validateReset($credentials);
+
// If the responses from the validate method is not a user instance, we will
// assume that it is a redirect and simply return it from this method and
// the user is properly redirected having an error message on the post.
- $user = $this->validateReset($credentials);
-
if (! $user instanceof CanResetPasswordContract) {
return $user;
}
@@ -115,66 +107,13 @@ protected function validateReset(array $credentials)
return static::INVALID_USER;
}
- if (! $this->validateNewPassword($credentials)) {
- return static::INVALID_PASSWORD;
- }
-
if (! $this->tokens->exists($user, $credentials['token'])) {
return static::INVALID_TOKEN;
}
return $user;
}
- /**
- * Set a custom password validator.
- *
- * @param \Closure $callback
- * @return void
- */
- public function validator(Closure $callback)
- {
- $this->passwordValidator = $callback;
- }
-
- /**
- * Determine if the passwords match for the request.
- *
- * @param array $credentials
- * @return bool
- */
- public function validateNewPassword(array $credentials)
- {
- if (isset($this->passwordValidator)) {
- [$password, $confirm] = [
- $credentials['password'],
- $credentials['password_confirmation'],
- ];
-
- return call_user_func(
- $this->passwordValidator, $credentials
- ) && $password === $confirm;
- }
-
- return $this->validatePasswordWithDefaults($credentials);
- }
-
- /**
- * Determine if the passwords are valid for the request.
- *
- * @param array $credentials
- * @return bool
- */
- protected function validatePasswordWithDefaults(array $credentials)
- {
- [$password, $confirm] = [
- $credentials['password'],
- $credentials['password_confirmation'],
- ];
-
- return $password === $confirm && mb_strlen($password) > 0;
- }
-
/**
* Get the user for the given credentials.
* | true |
Other | laravel | framework | 88ec20dbaac61453f1f48e4013af3b3d96ad0729.json | Remove new password validation from broker
These changes remove all hardcoded valdation from the PasswordBroker. The reason for this is because this is a hardcoded constraint in validation and thus limits people from building password reset forms with their specific flow. The validation is already done within the ResetsPassword trait and is only duplicated in the Broker. The Broker also seems like the wrong place to do this as it only facilitates the retrieval of the user and the token validation (which is still the correct place for these two).
This also allows us to remove the https://github.com/laravel/laravel/blob/develop/resources/lang/en/passwords.php#L16 language line.
See https://github.com/laravel/framework/pull/25957#issuecomment-519662680 | src/Illuminate/Contracts/Auth/PasswordBroker.php | @@ -27,13 +27,6 @@ interface PasswordBroker
*/
const INVALID_USER = 'passwords.user';
- /**
- * Constant representing an invalid password.
- *
- * @var string
- */
- const INVALID_PASSWORD = 'passwords.password';
-
/**
* Constant representing an invalid token.
*
@@ -57,20 +50,4 @@ public function sendResetLink(array $credentials);
* @return mixed
*/
public function reset(array $credentials, Closure $callback);
-
- /**
- * Set a custom password validator.
- *
- * @param \Closure $callback
- * @return void
- */
- public function validator(Closure $callback);
-
- /**
- * Determine if the passwords match for the request.
- *
- * @param array $credentials
- * @return bool
- */
- public function validateNewPassword(array $credentials);
} | true |
Other | laravel | framework | 88ec20dbaac61453f1f48e4013af3b3d96ad0729.json | Remove new password validation from broker
These changes remove all hardcoded valdation from the PasswordBroker. The reason for this is because this is a hardcoded constraint in validation and thus limits people from building password reset forms with their specific flow. The validation is already done within the ResetsPassword trait and is only duplicated in the Broker. The Broker also seems like the wrong place to do this as it only facilitates the retrieval of the user and the token validation (which is still the correct place for these two).
This also allows us to remove the https://github.com/laravel/laravel/blob/develop/resources/lang/en/passwords.php#L16 language line.
See https://github.com/laravel/framework/pull/25957#issuecomment-519662680 | tests/Auth/AuthPasswordBrokerTest.php | @@ -72,48 +72,11 @@ public function testRedirectIsReturnedByResetWhenUserCredentialsInvalid()
}));
}
- public function testRedirectReturnedByRemindWhenPasswordsDontMatch()
- {
- $creds = ['password' => 'foo', 'password_confirmation' => 'bar'];
- $broker = $this->getBroker($mocks = $this->getMocks());
- $mocks['users']->shouldReceive('retrieveByCredentials')->once()->with($creds)->andReturn($user = m::mock(CanResetPassword::class));
-
- $this->assertEquals(PasswordBrokerContract::INVALID_PASSWORD, $broker->reset($creds, function () {
- //
- }));
- }
-
- public function testRedirectReturnedByRemindWhenPasswordNotSet()
- {
- $creds = ['password' => null, 'password_confirmation' => null];
- $broker = $this->getBroker($mocks = $this->getMocks());
- $mocks['users']->shouldReceive('retrieveByCredentials')->once()->with($creds)->andReturn($user = m::mock(CanResetPassword::class));
-
- $this->assertEquals(PasswordBrokerContract::INVALID_PASSWORD, $broker->reset($creds, function () {
- //
- }));
- }
-
- public function testRedirectReturnedByRemindWhenPasswordDoesntPassValidator()
- {
- $creds = ['password' => 'abcdef', 'password_confirmation' => 'abcdef'];
- $broker = $this->getBroker($mocks = $this->getMocks());
- $broker->validator(function ($credentials) {
- return strlen($credentials['password']) >= 7;
- });
- $mocks['users']->shouldReceive('retrieveByCredentials')->once()->with($creds)->andReturn($user = m::mock(CanResetPassword::class));
-
- $this->assertEquals(PasswordBrokerContract::INVALID_PASSWORD, $broker->reset($creds, function () {
- //
- }));
- }
-
public function testRedirectReturnedByRemindWhenRecordDoesntExistInTable()
{
$creds = ['token' => 'token'];
- $broker = $this->getMockBuilder(PasswordBroker::class)->setMethods(['validateNewPassword'])->setConstructorArgs(array_values($mocks = $this->getMocks()))->getMock();
+ $broker = $this->getBroker($mocks = $this->getMocks());
$mocks['users']->shouldReceive('retrieveByCredentials')->once()->with(Arr::except($creds, ['token']))->andReturn($user = m::mock(CanResetPassword::class));
- $broker->expects($this->once())->method('validateNewPassword')->will($this->returnValue(true));
$mocks['tokens']->shouldReceive('exists')->with($user, 'token')->andReturn(false);
$this->assertEquals(PasswordBrokerContract::INVALID_TOKEN, $broker->reset($creds, function () { | true |
Other | laravel | framework | 4a2083bc25c37b44dc966161d4172f36a1215464.json | Return collect() and add missing ->filter() | src/Illuminate/Console/Command.php | @@ -239,9 +239,9 @@ protected function context()
{
$options = array_only($this->option(), ['no-interaction', 'ansi', 'no-ansi', 'quiet', 'verbose']);
- collect($options)->mapWithKeys(function ($value, $key) {
+ return collect($options)->mapWithKeys(function ($value, $key) {
return ["--{$key}" => $value];
- })->all();
+ })->filter()->all();
}
/** | false |
Other | laravel | framework | a879fd1428713913bd0d67b2eb7612d1dd4edd19.json | Use method to detect the application environment | src/Illuminate/Console/ConfirmableTrait.php | @@ -48,7 +48,7 @@ public function confirmToProceed($warning = 'Application In Production!', $callb
protected function getDefaultConfirmCallback()
{
return function () {
- return $this->getLaravel()->environment() === 'production';
+ return $this->getLaravel()->isProduction();
};
}
} | true |
Other | laravel | framework | a879fd1428713913bd0d67b2eb7612d1dd4edd19.json | Use method to detect the application environment | src/Illuminate/Foundation/Bootstrap/HandleExceptions.php | @@ -46,7 +46,7 @@ public function bootstrap(Application $app)
register_shutdown_function([$this, 'handleShutdown']);
- if (! $app->environment('testing')) {
+ if (! $app->runningUnitTests()) {
ini_set('display_errors', 'Off');
}
} | true |
Other | laravel | framework | 8e54534afcb4a0347107fc04535a6276431be285.json | Remove some unused variables. | tests/Database/DatabaseEloquentModelTest.php | @@ -1877,7 +1877,7 @@ public function testIsWithAnotherConnection()
public function testWithoutTouchingCallback()
{
- $model = new EloquentModelStub(['id' => 1]);
+ new EloquentModelStub(['id' => 1]);
$called = false;
@@ -1890,7 +1890,7 @@ public function testWithoutTouchingCallback()
public function testWithoutTouchingOnCallback()
{
- $model = new EloquentModelStub(['id' => 1]);
+ new EloquentModelStub(['id' => 1]);
$called = false;
| true |
Other | laravel | framework | 8e54534afcb4a0347107fc04535a6276431be285.json | Remove some unused variables. | tests/Database/DatabaseQueryBuilderTest.php | @@ -3004,7 +3004,6 @@ public function testPaginate()
public function testPaginateWithDefaultArguments()
{
$perPage = 15;
- $columns = ['*'];
$pageName = 'page';
$page = 1;
$builder = $this->getMockQueryBuilder();
@@ -3035,7 +3034,6 @@ public function testPaginateWithDefaultArguments()
public function testPaginateWhenNoResults()
{
$perPage = 15;
- $columns = ['*'];
$pageName = 'page';
$page = 1;
$builder = $this->getMockQueryBuilder(); | true |
Other | laravel | framework | 8e54534afcb4a0347107fc04535a6276431be285.json | Remove some unused variables. | tests/Foundation/Http/Middleware/CheckForMaintenanceModeTest.php | @@ -96,7 +96,7 @@ public function testApplicationDeniesSomeIPs()
$middleware = new CheckForMaintenanceMode($this->createMaintenanceApplication());
- $result = $middleware->handle(Request::create('/'), function ($request) {
+ $middleware->handle(Request::create('/'), function ($request) {
});
}
@@ -127,7 +127,7 @@ public function testApplicationDeniesSomeURIs()
$middleware = new CheckForMaintenanceMode($this->createMaintenanceApplication());
- $result = $middleware->handle(Request::create('/foo/bar'), function ($request) {
+ $middleware->handle(Request::create('/foo/bar'), function ($request) {
});
}
| true |
Other | laravel | framework | 8e54534afcb4a0347107fc04535a6276431be285.json | Remove some unused variables. | tests/Integration/Session/SessionPersistenceTest.php | @@ -30,7 +30,7 @@ public function test_session_is_persisted_even_if_exception_is_thrown_from_route
throw new TokenMismatchException;
})->middleware('web');
- $response = $this->get('/');
+ $this->get('/');
$this->assertTrue($handler->written);
}
| true |
Other | laravel | framework | 8e54534afcb4a0347107fc04535a6276431be285.json | Remove some unused variables. | tests/Support/SupportHelpersTest.php | @@ -520,7 +520,7 @@ public function testRetryWithFailingWhenCallback()
{
$this->expectException(RuntimeException::class);
- $attempts = retry(2, function ($attempts) {
+ retry(2, function ($attempts) {
if ($attempts > 1) {
return $attempts;
} | true |
Other | laravel | framework | 3b67d44a563116f7bbf4f8a0a8a632d0c4a5fcd6.json | Simplify Blade tests. | tests/View/Blade/AbstractBladeTestCase.php | @@ -9,11 +9,14 @@
abstract class AbstractBladeTestCase extends TestCase
{
+ /**
+ * @var \Illuminate\View\Compilers\BladeCompiler
+ */
protected $compiler;
protected function setUp(): void
{
- $this->compiler = new BladeCompiler(m::mock(Filesystem::class), __DIR__);
+ $this->compiler = new BladeCompiler($this->getFiles(), __DIR__);
parent::setUp();
}
@@ -23,4 +26,9 @@ protected function tearDown(): void
parent::tearDown();
}
+
+ protected function getFiles()
+ {
+ return m::mock(Filesystem::class);
+ }
} | true |
Other | laravel | framework | 3b67d44a563116f7bbf4f8a0a8a632d0c4a5fcd6.json | Simplify Blade tests. | tests/View/Blade/BladeElseAuthStatementsTest.php | @@ -2,21 +2,10 @@
namespace Illuminate\Tests\View\Blade;
-use Mockery as m;
-use PHPUnit\Framework\TestCase;
-use Illuminate\Filesystem\Filesystem;
-use Illuminate\View\Compilers\BladeCompiler;
-
-class BladeElseAuthStatementsTest extends TestCase
+class BladeElseAuthStatementsTest extends AbstractBladeTestCase
{
- protected function tearDown(): void
- {
- m::close();
- }
-
public function testElseAuthStatementsAreCompiled()
{
- $compiler = new BladeCompiler($this->getFiles(), __DIR__);
$string = '@auth("api")
breeze
@elseauth("standard")
@@ -27,12 +16,11 @@ public function testElseAuthStatementsAreCompiled()
<?php elseif(auth()->guard("standard")->check()): ?>
wheeze
<?php endif; ?>';
- $this->assertEquals($expected, $compiler->compileString($string));
+ $this->assertEquals($expected, $this->compiler->compileString($string));
}
public function testPlainElseAuthStatementsAreCompiled()
{
- $compiler = new BladeCompiler($this->getFiles(), __DIR__);
$string = '@auth("api")
breeze
@elseauth
@@ -43,11 +31,6 @@ public function testPlainElseAuthStatementsAreCompiled()
<?php elseif(auth()->guard()->check()): ?>
wheeze
<?php endif; ?>';
- $this->assertEquals($expected, $compiler->compileString($string));
- }
-
- protected function getFiles()
- {
- return m::mock(Filesystem::class);
+ $this->assertEquals($expected, $this->compiler->compileString($string));
}
} | true |
Other | laravel | framework | 3b67d44a563116f7bbf4f8a0a8a632d0c4a5fcd6.json | Simplify Blade tests. | tests/View/Blade/BladeElseGuestStatementsTest.php | @@ -2,21 +2,10 @@
namespace Illuminate\Tests\View\Blade;
-use Mockery as m;
-use PHPUnit\Framework\TestCase;
-use Illuminate\Filesystem\Filesystem;
-use Illuminate\View\Compilers\BladeCompiler;
-
-class BladeElseGuestStatementsTest extends TestCase
+class BladeElseGuestStatementsTest extends AbstractBladeTestCase
{
- protected function tearDown(): void
- {
- m::close();
- }
-
public function testIfStatementsAreCompiled()
{
- $compiler = new BladeCompiler($this->getFiles(), __DIR__);
$string = '@guest("api")
breeze
@elseguest("standard")
@@ -27,11 +16,6 @@ public function testIfStatementsAreCompiled()
<?php elseif(auth()->guard("standard")->guest()): ?>
wheeze
<?php endif; ?>';
- $this->assertEquals($expected, $compiler->compileString($string));
- }
-
- protected function getFiles()
- {
- return m::mock(Filesystem::class);
+ $this->assertEquals($expected, $this->compiler->compileString($string));
}
} | true |
Other | laravel | framework | 3b67d44a563116f7bbf4f8a0a8a632d0c4a5fcd6.json | Simplify Blade tests. | tests/View/Blade/BladeIfAuthStatementsTest.php | @@ -2,44 +2,27 @@
namespace Illuminate\Tests\View\Blade;
-use Mockery as m;
-use PHPUnit\Framework\TestCase;
-use Illuminate\Filesystem\Filesystem;
-use Illuminate\View\Compilers\BladeCompiler;
-
-class BladeIfAuthStatementsTest extends TestCase
+class BladeIfAuthStatementsTest extends AbstractBladeTestCase
{
- protected function tearDown(): void
- {
- m::close();
- }
-
public function testIfStatementsAreCompiled()
{
- $compiler = new BladeCompiler($this->getFiles(), __DIR__);
$string = '@auth("api")
breeze
@endauth';
$expected = '<?php if(auth()->guard("api")->check()): ?>
breeze
<?php endif; ?>';
- $this->assertEquals($expected, $compiler->compileString($string));
+ $this->assertEquals($expected, $this->compiler->compileString($string));
}
public function testPlainIfStatementsAreCompiled()
{
- $compiler = new BladeCompiler($this->getFiles(), __DIR__);
$string = '@auth
breeze
@endauth';
$expected = '<?php if(auth()->guard()->check()): ?>
breeze
<?php endif; ?>';
- $this->assertEquals($expected, $compiler->compileString($string));
- }
-
- protected function getFiles()
- {
- return m::mock(Filesystem::class);
+ $this->assertEquals($expected, $this->compiler->compileString($string));
}
} | true |
Other | laravel | framework | 3b67d44a563116f7bbf4f8a0a8a632d0c4a5fcd6.json | Simplify Blade tests. | tests/View/Blade/BladeIfGuestStatementsTest.php | @@ -2,32 +2,16 @@
namespace Illuminate\Tests\View\Blade;
-use Mockery as m;
-use PHPUnit\Framework\TestCase;
-use Illuminate\Filesystem\Filesystem;
-use Illuminate\View\Compilers\BladeCompiler;
-
-class BladeIfGuestStatementsTest extends TestCase
+class BladeIfGuestStatementsTest extends AbstractBladeTestCase
{
- protected function tearDown(): void
- {
- m::close();
- }
-
public function testIfStatementsAreCompiled()
{
- $compiler = new BladeCompiler($this->getFiles(), __DIR__);
$string = '@guest("api")
breeze
@endguest';
$expected = '<?php if(auth()->guard("api")->guest()): ?>
breeze
<?php endif; ?>';
- $this->assertEquals($expected, $compiler->compileString($string));
- }
-
- protected function getFiles()
- {
- return m::mock(Filesystem::class);
+ $this->assertEquals($expected, $this->compiler->compileString($string));
}
} | true |
Other | laravel | framework | e9253da59b8542f25ae3cc0ce287da7d4dd433cf.json | Implement usage of global `last()` helper
Co-Authored-By: Jonas Staudenmeir <mail@jonas-staudenmeir.de> | src/Illuminate/Database/Query/Grammars/PostgresGrammar.php | @@ -248,7 +248,7 @@ protected function compileUpdateColumns($query, $values)
// columns and convert it to a parameter value. Then we will concatenate a
// list of the columns that can be added into this update query clauses.
return collect($values)->map(function ($value, $key) {
- $column = Arr::last(explode('.', $key));
+ $column = last(explode('.', $key));
if ($this->isJsonSelector($key)) {
return $this->compileJsonUpdateColumn($column, $value); | false |
Other | laravel | framework | dbe03179ecac5aeafacd5c7355eb29ac129c554b.json | Add additional tests for object binding
This adds additional testing of binding datetimes for update statements with the query builder.
Provides extra coverage for https://github.com/laravel/framework/pull/29146 and https://github.com/laravel/framework/pull/29388 | tests/Database/DatabaseQueryBuilderTest.php | @@ -2,6 +2,7 @@
namespace Illuminate\Tests\Database;
+use DateTime;
use stdClass;
use Mockery as m;
use RuntimeException;
@@ -2295,10 +2296,11 @@ public function testMySqlUpdateWrappingJsonArray()
$connection->expects($this->once())
->method('update')
->with(
- 'update `users` set `options` = ?, `meta` = json_set(`meta`, \'$."tags"\', cast(? as json)), `group_id` = 45 where `active` = ?',
+ 'update `users` set `options` = ?, `meta` = json_set(`meta`, \'$."tags"\', cast(? as json)), `group_id` = 45, `created_at` = ? where `active` = ?',
[
json_encode(['2fa' => false, 'presets' => ['laravel', 'vue']]),
json_encode(['white', 'large']),
+ new DateTime('2019-08-06'),
1,
]
);
@@ -2308,6 +2310,7 @@ public function testMySqlUpdateWrappingJsonArray()
'options' => ['2fa' => false, 'presets' => ['laravel', 'vue']],
'meta->tags' => ['white', 'large'],
'group_id' => new Raw('45'),
+ 'created_at' => new DateTime('2019-08-06'),
]);
}
@@ -2361,15 +2364,17 @@ public function testPostgresUpdateWrappingJsonArray()
{
$builder = $this->getPostgresBuilder();
$builder->getConnection()->shouldReceive('update')
- ->with('update "users" set "options" = ?, "meta" = jsonb_set("meta"::jsonb, \'{"tags"}\', ?), "group_id" = 45', [
+ ->with('update "users" set "options" = ?, "meta" = jsonb_set("meta"::jsonb, \'{"tags"}\', ?), "group_id" = 45, "created_at" = ?', [
json_encode(['2fa' => false, 'presets' => ['laravel', 'vue']]),
json_encode(['white', 'large']),
+ new DateTime('2019-08-06'),
]);
$builder->from('users')->update([
'options' => ['2fa' => false, 'presets' => ['laravel', 'vue']],
'meta->tags' => ['white', 'large'],
'group_id' => new Raw('45'),
+ 'created_at' => new DateTime('2019-08-06'),
]);
}
| false |
Other | laravel | framework | 647f59fd66999bea333554befc930c7acea1601a.json | Register ConnectionResolverInterface as core alias
This will allow us to resolve the interface rather than the concrete implementation from the container. | src/Illuminate/Foundation/Application.php | @@ -1138,7 +1138,7 @@ public function registerCoreContainerAliases()
'config' => [\Illuminate\Config\Repository::class, \Illuminate\Contracts\Config\Repository::class],
'cookie' => [\Illuminate\Cookie\CookieJar::class, \Illuminate\Contracts\Cookie\Factory::class, \Illuminate\Contracts\Cookie\QueueingFactory::class],
'encrypter' => [\Illuminate\Encryption\Encrypter::class, \Illuminate\Contracts\Encryption\Encrypter::class],
- 'db' => [\Illuminate\Database\DatabaseManager::class],
+ 'db' => [\Illuminate\Database\DatabaseManager::class, \Illuminate\Database\ConnectionResolverInterface::class],
'db.connection' => [\Illuminate\Database\Connection::class, \Illuminate\Database\ConnectionInterface::class],
'events' => [\Illuminate\Events\Dispatcher::class, \Illuminate\Contracts\Events\Dispatcher::class],
'files' => [\Illuminate\Filesystem\Filesystem::class], | true |
Other | laravel | framework | 647f59fd66999bea333554befc930c7acea1601a.json | Register ConnectionResolverInterface as core alias
This will allow us to resolve the interface rather than the concrete implementation from the container. | tests/Integration/Foundation/CoreContainerAliasesTest.php | @@ -0,0 +1,15 @@
+<?php
+
+namespace Illuminate\Tests\Integration\Foundation;
+
+use Orchestra\Testbench\TestCase;
+use Illuminate\Database\DatabaseManager;
+use Illuminate\Database\ConnectionResolverInterface;
+
+class CoreContainerAliasesTest extends TestCase
+{
+ public function test_it_can_resolve_core_container_aliases()
+ {
+ $this->assertInstanceOf(DatabaseManager::class, $this->app->make(ConnectionResolverInterface::class));
+ }
+} | true |
Other | laravel | framework | bd5bbb64802afa975b124917f5918f6421bae3e0.json | Remove extra space | src/Illuminate/Foundation/Application.php | @@ -1128,7 +1128,7 @@ public function isLocale($locale)
public function registerCoreContainerAliases()
{
foreach ([
- 'app' => [self::class, \Illuminate\Contracts\Container\Container::class, \Illuminate\Contracts\Foundation\Application::class, \Psr\Container\ContainerInterface::class],
+ 'app' => [self::class, \Illuminate\Contracts\Container\Container::class, \Illuminate\Contracts\Foundation\Application::class, \Psr\Container\ContainerInterface::class],
'auth' => [\Illuminate\Auth\AuthManager::class, \Illuminate\Contracts\Auth\Factory::class],
'auth.driver' => [\Illuminate\Contracts\Auth\Guard::class],
'blade.compiler' => [\Illuminate\View\Compilers\BladeCompiler::class], | false |
Other | laravel | framework | df041d2f92c3cc324617ee6707c8846e4e634872.json | Add test for cookie stuff. | tests/Integration/Cookie/CookieTest.php | @@ -0,0 +1,64 @@
+<?php
+
+namespace Illuminate\Tests\Integration\Cookie;
+
+use Mockery;
+use Illuminate\Support\Str;
+use Illuminate\Http\Response;
+use Illuminate\Support\Carbon;
+use Orchestra\Testbench\TestCase;
+use Illuminate\Support\Facades\Route;
+use Illuminate\Support\Facades\Session;
+use Illuminate\Session\NullSessionHandler;
+use Illuminate\Contracts\Debug\ExceptionHandler;
+
+/**
+ * @group integration
+ */
+class CookieTest extends TestCase
+{
+ public function test_cookie_is_sent_back_with_proper_expire_time_when_should_expire_on_close()
+ {
+ $this->app['config']->set('session.expire_on_close', true);
+
+ Route::get('/', function () {
+ return 'hello world';
+ })->middleware('web');
+
+ $response = $this->get('/');
+ $this->assertCount(2, $response->headers->getCookies());
+ $this->assertEquals(0, ($response->headers->getCookies()[1])->getExpiresTime());
+ }
+
+ public function test_cookie_is_sent_back_with_proper_expire_time_with_respect_to_lifetime()
+ {
+ $this->app['config']->set('session.expire_on_close', false);
+ $this->app['config']->set('session.lifetime', 1);
+
+ Route::get('/', function () {
+ return 'hello world';
+ })->middleware('web');
+
+ Carbon::setTestNow(Carbon::now());
+ $response = $this->get('/');
+ $this->assertCount(2, $response->headers->getCookies());
+ $this->assertEquals(Carbon::now()->getTimestamp() + 60, ($response->headers->getCookies()[1])->getExpiresTime());
+ }
+
+ protected function getEnvironmentSetUp($app)
+ {
+ $app->instance(
+ ExceptionHandler::class,
+ $handler = Mockery::mock(ExceptionHandler::class)->shouldIgnoreMissing()
+ );
+
+ $handler->shouldReceive('render')->andReturn(new Response);
+
+ $app['config']->set('app.key', Str::random(32));
+ $app['config']->set('session.driver', 'fake-null');
+
+ Session::extend('fake-null', function () {
+ return new NullSessionHandler;
+ });
+ }
+} | false |
Other | laravel | framework | 78c19ef9a37e405e4e718e3723b3ec5458f872a0.json | add tests for session's save method | tests/Session/SessionStoreTest.php | @@ -4,6 +4,7 @@
use Mockery as m;
use ReflectionClass;
+use Illuminate\Support\Str;
use SessionHandlerInterface;
use Illuminate\Session\Store;
use PHPUnit\Framework\TestCase;
@@ -93,7 +94,7 @@ public function testSessionInvalidate()
$this->assertCount(0, $session->all());
}
- public function testSessionIsProperlySaved()
+ public function testBrandNewSessionIsProperlySaved()
{
$session = $this->getSession();
$session->getHandler()->shouldReceive('read')->once()->andReturn(serialize([]));
@@ -118,6 +119,69 @@ public function testSessionIsProperlySaved()
$this->assertFalse($session->isStarted());
}
+ public function testSessionIsProperlyUpdated()
+ {
+ $session = $this->getSession();
+ $session->getHandler()->shouldReceive('read')->once()->andReturn(serialize([
+ '_token' => Str::random(40),
+ 'foo' => 'bar',
+ 'baz' => 'boom',
+ '_flash' => [
+ 'new' => [],
+ 'old' => ['baz'],
+ ],
+ ]));
+ $session->start();
+
+ $session->getHandler()->shouldReceive('write')->once()->with(
+ $this->getSessionId(),
+ serialize([
+ '_token' => $session->token(),
+ 'foo' => 'bar',
+ '_flash' => [
+ 'new' => [],
+ 'old' => [],
+ ],
+ ])
+ );
+
+ $session->save();
+
+ $this->assertFalse($session->isStarted());
+ }
+
+ public function testSessionIsReSavedWhenNothingHasChanged()
+ {
+ $session = $this->getSession();
+ $session->getHandler()->shouldReceive('read')->once()->andReturn(serialize([
+ '_token' => Str::random(40),
+ 'foo' => 'bar',
+ 'baz' => 'boom',
+ '_flash' => [
+ 'new' => [],
+ 'old' => [],
+ ],
+ ]));
+ $session->start();
+
+ $session->getHandler()->shouldReceive('write')->once()->with(
+ $this->getSessionId(),
+ serialize([
+ '_token' => $session->token(),
+ 'foo' => 'bar',
+ 'baz' => 'boom',
+ '_flash' => [
+ 'new' => [],
+ 'old' => [],
+ ],
+ ])
+ );
+
+ $session->save();
+
+ $this->assertFalse($session->isStarted());
+ }
+
public function testOldInputFlashing()
{
$session = $this->getSession(); | false |
Other | laravel | framework | 3dafb5a3840053420d850e1ccb249efc980af94e.json | Add line break for plain text mails
This change adds a manual line break in addition to the existing HTML-only `<br>`. Before this change the text was `Regards,Laravel`. | src/Illuminate/Notifications/resources/views/email.blade.php | @@ -43,7 +43,8 @@
@if (! empty($salutation))
{{ $salutation }}
@else
-@lang('Regards'),<br>{{ config('app.name') }}
+@lang('Regards'),<br>
+{{ config('app.name') }}
@endif
{{-- Subcopy --}} | false |
Other | laravel | framework | 6cd0b1bd909cd48ca40d2d8e1826364684e123ec.json | Add logoutCurrentDevice method | src/Illuminate/Auth/Events/CurrentDeviceLogout.php | @@ -0,0 +1,37 @@
+<?php
+
+namespace Illuminate\Auth\Events;
+
+use Illuminate\Queue\SerializesModels;
+
+class CurrentDeviceLogout
+{
+ use SerializesModels;
+
+ /**
+ * The authentication guard name.
+ *
+ * @var string
+ */
+ public $guard;
+
+ /**
+ * The authenticated user.
+ *
+ * @var \Illuminate\Contracts\Auth\Authenticatable
+ */
+ public $user;
+
+ /**
+ * Create a new event instance.
+ *
+ * @param string $guard
+ * @param \Illuminate\Contracts\Auth\Authenticatable $user
+ * @return void
+ */
+ public function __construct($guard, $user)
+ {
+ $this->user = $user;
+ $this->guard = $guard;
+ }
+} | true |
Other | laravel | framework | 6cd0b1bd909cd48ca40d2d8e1826364684e123ec.json | Add logoutCurrentDevice method | src/Illuminate/Auth/SessionGuard.php | @@ -531,6 +531,32 @@ protected function cycleRememberToken(AuthenticatableContract $user)
$this->provider->updateRememberToken($user, $token);
}
+ /**
+ * Log this session out for the current user.
+ *
+ * @return void
+ */
+ public function logoutCurrentDevice()
+ {
+ $user = $this->user();
+
+ // If we have an event dispatcher instance, we can fire off the logout event
+ // so any further processing can be done. This allows the developer to be
+ // listening for anytime a user signs out of this application manually.
+ $this->clearUserDataFromStorage();
+
+ if (isset($this->events)) {
+ $this->events->dispatch(new Events\CurrentDeviceLogout($this->name, $user));
+ }
+
+ // Once we have fired the logout event we will clear the users out of memory
+ // so they are no longer available as the user is no longer considered as
+ // being signed into this application and should not be available here.
+ $this->user = null;
+
+ $this->loggedOut = true;
+ }
+
/**
* Invalidate other sessions for the current user.
* | true |
Other | laravel | framework | 6cd0b1bd909cd48ca40d2d8e1826364684e123ec.json | Add logoutCurrentDevice method | tests/Auth/AuthGuardTest.php | @@ -19,6 +19,7 @@
use Symfony\Component\HttpFoundation\Request;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Contracts\Encryption\Encrypter;
+use Illuminate\Auth\Events\CurrentDeviceLogout;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
class AuthGuardTest extends TestCase
@@ -325,6 +326,55 @@ public function testLogoutDoesNotSetRememberTokenIfNotPreviouslySet()
$mock->logout();
}
+ public function testLogoutCurrentDeviceRemovesRememberMeCookie()
+ {
+ [$session, $provider, $request, $cookie] = $this->getMocks();
+ $mock = $this->getMockBuilder(SessionGuard::class)->setMethods(['getName', 'getRecallerName', 'recaller'])->setConstructorArgs(['default', $provider, $session, $request])->getMock();
+ $mock->setCookieJar($cookies = m::mock(CookieJar::class));
+ $user = m::mock(Authenticatable::class);
+ $mock->expects($this->once())->method('getName')->will($this->returnValue('foo'));
+ $mock->expects($this->once())->method('getRecallerName')->will($this->returnValue('bar'));
+ $mock->expects($this->once())->method('recaller')->will($this->returnValue('non-null-cookie'));
+
+ $cookie = m::mock(Cookie::class);
+ $cookies->shouldReceive('forget')->once()->with('bar')->andReturn($cookie);
+ $cookies->shouldReceive('queue')->once()->with($cookie);
+ $mock->getSession()->shouldReceive('remove')->once()->with('foo');
+ $mock->setUser($user);
+ $mock->logoutCurrentDevice();
+ $this->assertNull($mock->getUser());
+ }
+
+ public function testLogoutCurrentDeviceDoesNotEnqueueRememberMeCookieForDeletionIfCookieDoesntExist()
+ {
+ [$session, $provider, $request, $cookie] = $this->getMocks();
+ $mock = $this->getMockBuilder(SessionGuard::class)->setMethods(['getName', 'recaller'])->setConstructorArgs(['default', $provider, $session, $request])->getMock();
+ $mock->setCookieJar($cookies = m::mock(CookieJar::class));
+ $user = m::mock(Authenticatable::class);
+ $user->shouldReceive('getRememberToken')->andReturn(null);
+ $mock->expects($this->once())->method('getName')->will($this->returnValue('foo'));
+ $mock->expects($this->once())->method('recaller')->will($this->returnValue(null));
+
+ $mock->getSession()->shouldReceive('remove')->once()->with('foo');
+ $mock->setUser($user);
+ $mock->logoutCurrentDevice();
+ $this->assertNull($mock->getUser());
+ }
+
+ public function testLogoutCurrentDeviceFiresLogoutEvent()
+ {
+ [$session, $provider, $request, $cookie] = $this->getMocks();
+ $mock = $this->getMockBuilder(SessionGuard::class)->setMethods(['clearUserDataFromStorage'])->setConstructorArgs(['default', $provider, $session, $request])->getMock();
+ $mock->expects($this->once())->method('clearUserDataFromStorage');
+ $mock->setDispatcher($events = m::mock(Dispatcher::class));
+ $user = m::mock(Authenticatable::class);
+ $user->shouldReceive('getRememberToken')->andReturn(null);
+ $events->shouldReceive('dispatch')->once()->with(m::type(Authenticated::class));
+ $mock->setUser($user);
+ $events->shouldReceive('dispatch')->once()->with(m::type(CurrentDeviceLogout::class));
+ $mock->logoutCurrentDevice();
+ }
+
public function testLoginMethodQueuesCookieWhenRemembering()
{
[$session, $provider, $request, $cookie] = $this->getMocks(); | true |
Other | laravel | framework | 6cd0b1bd909cd48ca40d2d8e1826364684e123ec.json | Add logoutCurrentDevice method | tests/Integration/Auth/AuthenticationTest.php | @@ -229,6 +229,24 @@ public function test_logging_in_out_via_attempt_remembering()
$this->assertNotEquals($oldToken, $user->getRememberToken());
}
+ public function test_logging_in_out_current_device_via_remembering()
+ {
+ $this->assertTrue(
+ $this->app['auth']->attempt(['email' => 'email', 'password' => 'password'], true)
+ );
+ $this->assertInstanceOf(AuthenticationTestUser::class, $this->app['auth']->user());
+ $this->assertTrue($this->app['auth']->check());
+ $this->assertNotNull($this->app['auth']->user()->getRememberToken());
+
+ $oldToken = $this->app['auth']->user()->getRememberToken();
+ $user = $this->app['auth']->user();
+
+ $this->app['auth']->logoutCurrentDevice();
+
+ $this->assertNotNull($user->getRememberToken());
+ $this->assertEquals($oldToken, $user->getRememberToken());
+ }
+
public function test_auth_via_attempt_remembering()
{
$provider = new EloquentUserProvider(app('hash'), AuthenticationTestUser::class); | true |
Other | laravel | framework | 3495ebd7c830ed37b737003d58d991038b479616.json | Improve UPDATE and DELETE queries on PostgreSQL | src/Illuminate/Database/Query/Grammars/PostgresGrammar.php | @@ -243,11 +243,13 @@ public function compileUpdate(Builder $query, $values)
// the values in the list of bindings so we can make the sets statements.
$columns = $this->compileUpdateColumns($query, $values);
- $from = $this->compileUpdateFrom($query);
+ if (isset($query->joins) || isset($query->limit)) {
+ return $this->compileUpdateWithJoinsOrLimit($query, $columns);
+ }
- $where = $this->compileUpdateWheres($query);
+ $where = $this->compileWheres($query);
- return trim("update {$table} set {$columns}{$from} {$where}");
+ return trim("update {$table} set {$columns} {$where}");
}
/**
@@ -292,77 +294,23 @@ protected function compileJsonUpdateColumn($key, $value)
}
/**
- * Compile the "from" clause for an update with a join.
- *
- * @param \Illuminate\Database\Query\Builder $query
- * @return string|null
- */
- protected function compileUpdateFrom(Builder $query)
- {
- if (! isset($query->joins)) {
- return '';
- }
-
- // When using Postgres, updates with joins list the joined tables in the from
- // clause, which is different than other systems like MySQL. Here, we will
- // compile out the tables that are joined and add them to a from clause.
- $froms = collect($query->joins)->map(function ($join) {
- return $this->wrapTable($join->table);
- })->all();
-
- if (count($froms) > 0) {
- return ' from '.implode(', ', $froms);
- }
- }
-
- /**
- * Compile the additional where clauses for updates with joins.
+ * Compile an update statement with joins or limit into SQL.
*
* @param \Illuminate\Database\Query\Builder $query
+ * @param string $columns
* @return string
*/
- protected function compileUpdateWheres(Builder $query)
+ protected function compileUpdateWithJoinsOrLimit(Builder $query, $columns)
{
- $baseWheres = $this->compileWheres($query);
+ $table = $this->wrapTable($query->from);
- if (! isset($query->joins)) {
- return $baseWheres;
- }
+ $segments = preg_split('/\s+as\s+/i', $query->from);
- // Once we compile the join constraints, we will either use them as the where
- // clause or append them to the existing base where clauses. If we need to
- // strip the leading boolean we will do so when using as the only where.
- $joinWheres = $this->compileUpdateJoinWheres($query);
+ $alias = $segments[1] ?? $segments[0];
- if (trim($baseWheres) == '') {
- return 'where '.$this->removeLeadingBoolean($joinWheres);
- }
+ $selectSql = $this->compileSelect($query->select($alias.'.ctid'));
- return $baseWheres.' '.$joinWheres;
- }
-
- /**
- * Compile the "join" clause where clauses for an update.
- *
- * @param \Illuminate\Database\Query\Builder $query
- * @return string
- */
- protected function compileUpdateJoinWheres(Builder $query)
- {
- $joinWheres = [];
-
- // Here we will just loop through all of the join constraints and compile them
- // all out then implode them. This should give us "where" like syntax after
- // everything has been built and then we will join it to the real wheres.
- foreach ($query->joins as $join) {
- foreach ($join->wheres as $where) {
- $method = "where{$where['type']}";
-
- $joinWheres[] = $where['boolean'].' '.$this->$method($query, $where);
- }
- }
-
- return implode(' ', $joinWheres);
+ return "update {$table} set {$columns} where {$this->wrap('ctid')} in ({$selectSql})";
}
/**
@@ -380,10 +328,10 @@ public function prepareBindingsForUpdate(array $bindings, array $values)
: $value;
})->all();
- $bindingsWithoutWhere = Arr::except($bindings, ['select', 'where']);
+ $cleanBindings = Arr::except($bindings, 'select');
return array_values(
- array_merge($values, $bindings['where'], Arr::flatten($bindingsWithoutWhere))
+ array_merge($values, Arr::flatten($cleanBindings))
);
}
@@ -395,44 +343,30 @@ public function prepareBindingsForUpdate(array $bindings, array $values)
*/
public function compileDelete(Builder $query)
{
- $table = $this->wrapTable($query->from);
+ if (isset($query->joins) || isset($query->limit)) {
+ return $this->compileDeleteWithJoinsOrLimit($query);
+ }
- return isset($query->joins)
- ? $this->compileDeleteWithJoins($query, $table)
- : parent::compileDelete($query);
+ return parent::compileDelete($query);
}
/**
- * Compile a delete query that uses joins.
+ * Compile a delete statement with joins or limit into SQL.
*
* @param \Illuminate\Database\Query\Builder $query
- * @param string $table
* @return string
*/
- protected function compileDeleteWithJoins($query, $table)
+ protected function compileDeleteWithJoinsOrLimit(Builder $query)
{
- $using = ' USING '.collect($query->joins)->map(function ($join) {
- return $this->wrapTable($join->table);
- })->implode(', ');
+ $table = $this->wrapTable($query->from);
- $where = $this->compileUpdateWheres($query);
+ $segments = preg_split('/\s+as\s+/i', $query->from);
- return trim("delete from {$table}{$using} {$where}");
- }
+ $alias = $segments[1] ?? $segments[0];
- /**
- * Prepare the bindings for a delete statement.
- *
- * @param array $bindings
- * @return array
- */
- public function prepareBindingsForDelete(array $bindings)
- {
- $bindingsWithoutWhere = Arr::except($bindings, ['select', 'where']);
+ $selectSql = $this->compileSelect($query->select($alias.'.ctid'));
- return array_values(
- array_merge($bindings['where'], Arr::flatten($bindingsWithoutWhere))
- );
+ return "delete from {$table} where {$this->wrap('ctid')} in ({$selectSql})";
}
/** | true |
Other | laravel | framework | 3495ebd7c830ed37b737003d58d991038b479616.json | Improve UPDATE and DELETE queries on PostgreSQL | tests/Database/DatabaseQueryBuilderTest.php | @@ -2040,20 +2040,20 @@ public function testUpdateMethodWithoutJoinsOnPostgres()
public function testUpdateMethodWithJoinsOnPostgres()
{
$builder = $this->getPostgresBuilder();
- $builder->getConnection()->shouldReceive('update')->once()->with('update "users" set "email" = ?, "name" = ? from "orders" where "users"."id" = ? and "users"."id" = "orders"."user_id"', ['foo', 'bar', 1])->andReturn(1);
+ $builder->getConnection()->shouldReceive('update')->once()->with('update "users" set "email" = ?, "name" = ? where "ctid" in (select "users"."ctid" from "users" inner join "orders" on "users"."id" = "orders"."user_id" where "users"."id" = ?)', ['foo', 'bar', 1])->andReturn(1);
$result = $builder->from('users')->join('orders', 'users.id', '=', 'orders.user_id')->where('users.id', '=', 1)->update(['email' => 'foo', 'name' => 'bar']);
$this->assertEquals(1, $result);
$builder = $this->getPostgresBuilder();
- $builder->getConnection()->shouldReceive('update')->once()->with('update "users" set "email" = ?, "name" = ? from "orders" where "users"."id" = "orders"."user_id" and "users"."id" = ?', ['foo', 'bar', 1])->andReturn(1);
+ $builder->getConnection()->shouldReceive('update')->once()->with('update "users" set "email" = ?, "name" = ? where "ctid" in (select "users"."ctid" from "users" inner join "orders" on "users"."id" = "orders"."user_id" and "users"."id" = ?)', ['foo', 'bar', 1])->andReturn(1);
$result = $builder->from('users')->join('orders', function ($join) {
$join->on('users.id', '=', 'orders.user_id')
->where('users.id', '=', 1);
})->update(['email' => 'foo', 'name' => 'bar']);
$this->assertEquals(1, $result);
$builder = $this->getPostgresBuilder();
- $builder->getConnection()->shouldReceive('update')->once()->with('update "users" set "email" = ?, "name" = ? from "orders" where "name" = ? and "users"."id" = "orders"."user_id" and "users"."id" = ?', ['foo', 'bar', 'baz', 1])->andReturn(1);
+ $builder->getConnection()->shouldReceive('update')->once()->with('update "users" set "email" = ?, "name" = ? where "ctid" in (select "users"."ctid" from "users" inner join "orders" on "users"."id" = "orders"."user_id" and "users"."id" = ? where "name" = ?)', ['foo', 'bar', 1, 'baz'])->andReturn(1);
$result = $builder->from('users')
->join('orders', function ($join) {
$join->on('users.id', '=', 'orders.user_id')
@@ -2190,22 +2190,22 @@ public function testDeleteWithJoinMethod()
$this->assertEquals(1, $result);
$builder = $this->getPostgresBuilder();
- $builder->getConnection()->shouldReceive('delete')->once()->with('delete from "users" USING "contacts" where "users"."email" = ? and "users"."id" = "contacts"."id"', ['foo'])->andReturn(1);
+ $builder->getConnection()->shouldReceive('delete')->once()->with('delete from "users" where "ctid" in (select "users"."ctid" from "users" inner join "contacts" on "users"."id" = "contacts"."id" where "users"."email" = ?)', ['foo'])->andReturn(1);
$result = $builder->from('users')->join('contacts', 'users.id', '=', 'contacts.id')->where('users.email', '=', 'foo')->delete();
$this->assertEquals(1, $result);
$builder = $this->getPostgresBuilder();
- $builder->getConnection()->shouldReceive('delete')->once()->with('delete from "users" as "a" USING "users" as "b" where "email" = ? and "a"."id" = "b"."user_id"', ['foo'])->andReturn(1);
+ $builder->getConnection()->shouldReceive('delete')->once()->with('delete from "users" as "a" where "ctid" in (select "a"."ctid" from "users" as "a" inner join "users" as "b" on "a"."id" = "b"."user_id" where "email" = ? order by "id" asc limit 1)', ['foo'])->andReturn(1);
$result = $builder->from('users AS a')->join('users AS b', 'a.id', '=', 'b.user_id')->where('email', '=', 'foo')->orderBy('id')->limit(1)->delete();
$this->assertEquals(1, $result);
$builder = $this->getPostgresBuilder();
- $builder->getConnection()->shouldReceive('delete')->once()->with('delete from "users" USING "contacts" where "users"."id" = ? and "users"."id" = "contacts"."id"', [1])->andReturn(1);
+ $builder->getConnection()->shouldReceive('delete')->once()->with('delete from "users" where "ctid" in (select "users"."ctid" from "users" inner join "contacts" on "users"."id" = "contacts"."id" where "users"."id" = ? order by "id" asc limit 1)', [1])->andReturn(1);
$result = $builder->from('users')->join('contacts', 'users.id', '=', 'contacts.id')->orderBy('id')->take(1)->delete(1);
$this->assertEquals(1, $result);
$builder = $this->getPostgresBuilder();
- $builder->getConnection()->shouldReceive('delete')->once()->with('delete from "users" USING "contacts" where "name" = ? and "users"."id" = "contacts"."user_id" and "users"."id" = ?', ['baz', 1])->andReturn(1);
+ $builder->getConnection()->shouldReceive('delete')->once()->with('delete from "users" where "ctid" in (select "users"."ctid" from "users" inner join "contacts" on "users"."id" = "contacts"."user_id" and "users"."id" = ? where "name" = ?)', [1, 'baz'])->andReturn(1);
$result = $builder->from('users')
->join('contacts', function ($join) {
$join->on('users.id', '=', 'contacts.user_id')
@@ -2215,7 +2215,7 @@ public function testDeleteWithJoinMethod()
$this->assertEquals(1, $result);
$builder = $this->getPostgresBuilder();
- $builder->getConnection()->shouldReceive('delete')->once()->with('delete from "users" USING "contacts" where "users"."id" = "contacts"."id"', [])->andReturn(1);
+ $builder->getConnection()->shouldReceive('delete')->once()->with('delete from "users" where "ctid" in (select "users"."ctid" from "users" inner join "contacts" on "users"."id" = "contacts"."id")', [])->andReturn(1);
$result = $builder->from('users')->join('contacts', 'users.id', '=', 'contacts.id')->delete();
$this->assertEquals(1, $result);
} | true |
Other | laravel | framework | 0ccd8687e010c7d335cc34e48a618a7c7722ad38.json | Apply fixes from StyleCI (#29390) | tests/Integration/Queue/CallQueuedHandlerTest.php | @@ -160,9 +160,10 @@ public function middleware()
public function handle($command, $next)
{
CallQueuedHandlerTestJobWithMiddleware::$middlewareCommand = $command;
+
return $next($command);
}
- }
+ },
];
}
}
@@ -187,6 +188,7 @@ class TestJobMiddleware
public function handle($command, $next)
{
$_SERVER['__test.dispatchMiddleware'] = true;
+
return $next($command);
}
} | false |
Other | laravel | framework | a37d88a3a3c193882f29aab88b33accbd995c749.json | change default job attempts from unlimited to 1 | src/Illuminate/Queue/Console/ListenCommand.php | @@ -21,7 +21,7 @@ class ListenCommand extends Command
{--queue= : The queue to listen on}
{--sleep=3 : Number of seconds to sleep when no job is available}
{--timeout=60 : The number of seconds a child process can run}
- {--tries=0 : Number of times to attempt a job before logging it failed}';
+ {--tries=1 : Number of times to attempt a job before logging it failed}';
/**
* The console command description. | true |
Other | laravel | framework | a37d88a3a3c193882f29aab88b33accbd995c749.json | change default job attempts from unlimited to 1 | src/Illuminate/Queue/Console/WorkCommand.php | @@ -29,7 +29,7 @@ class WorkCommand extends Command
{--memory=128 : The memory limit in megabytes}
{--sleep=3 : Number of seconds to sleep when no job is available}
{--timeout=60 : The number of seconds a child process can run}
- {--tries=0 : Number of times to attempt a job before logging it failed}';
+ {--tries=1 : Number of times to attempt a job before logging it failed}';
/**
* The console command description. | true |
Other | laravel | framework | a37d88a3a3c193882f29aab88b33accbd995c749.json | change default job attempts from unlimited to 1 | src/Illuminate/Queue/ListenerOptions.php | @@ -23,7 +23,7 @@ class ListenerOptions extends WorkerOptions
* @param bool $force
* @return void
*/
- public function __construct($environment = null, $delay = 0, $memory = 128, $timeout = 60, $sleep = 3, $maxTries = 0, $force = false)
+ public function __construct($environment = null, $delay = 0, $memory = 128, $timeout = 60, $sleep = 3, $maxTries = 1, $force = false)
{
$this->environment = $environment;
| true |
Other | laravel | framework | a37d88a3a3c193882f29aab88b33accbd995c749.json | change default job attempts from unlimited to 1 | src/Illuminate/Queue/WorkerOptions.php | @@ -65,7 +65,7 @@ class WorkerOptions
* @param bool $stopWhenEmpty
* @return void
*/
- public function __construct($delay = 0, $memory = 128, $timeout = 60, $sleep = 3, $maxTries = 0, $force = false, $stopWhenEmpty = false)
+ public function __construct($delay = 0, $memory = 128, $timeout = 60, $sleep = 3, $maxTries = 1, $force = false, $stopWhenEmpty = false)
{
$this->delay = $delay;
$this->sleep = $sleep; | true |
Other | laravel | framework | a37d88a3a3c193882f29aab88b33accbd995c749.json | change default job attempts from unlimited to 1 | tests/Queue/QueueListenerTest.php | @@ -49,7 +49,7 @@ public function testMakeProcessCorrectlyFormatsCommandLine()
$this->assertInstanceOf(Process::class, $process);
$this->assertEquals(__DIR__, $process->getWorkingDirectory());
$this->assertEquals(3, $process->getTimeout());
- $this->assertEquals($escape.PHP_BINARY.$escape." {$escape}artisan{$escape} {$escape}queue:work{$escape} {$escape}connection{$escape} {$escape}--once{$escape} {$escape}--queue=queue{$escape} {$escape}--delay=1{$escape} {$escape}--memory=2{$escape} {$escape}--sleep=3{$escape} {$escape}--tries=0{$escape}", $process->getCommandLine());
+ $this->assertEquals($escape.PHP_BINARY.$escape." {$escape}artisan{$escape} {$escape}queue:work{$escape} {$escape}connection{$escape} {$escape}--once{$escape} {$escape}--queue=queue{$escape} {$escape}--delay=1{$escape} {$escape}--memory=2{$escape} {$escape}--sleep=3{$escape} {$escape}--tries=1{$escape}", $process->getCommandLine());
}
public function testMakeProcessCorrectlyFormatsCommandLineWithAnEnvironmentSpecified()
@@ -65,7 +65,7 @@ public function testMakeProcessCorrectlyFormatsCommandLineWithAnEnvironmentSpeci
$this->assertInstanceOf(Process::class, $process);
$this->assertEquals(__DIR__, $process->getWorkingDirectory());
$this->assertEquals(3, $process->getTimeout());
- $this->assertEquals($escape.PHP_BINARY.$escape." {$escape}artisan{$escape} {$escape}queue:work{$escape} {$escape}connection{$escape} {$escape}--once{$escape} {$escape}--queue=queue{$escape} {$escape}--delay=1{$escape} {$escape}--memory=2{$escape} {$escape}--sleep=3{$escape} {$escape}--tries=0{$escape} {$escape}--env=test{$escape}", $process->getCommandLine());
+ $this->assertEquals($escape.PHP_BINARY.$escape." {$escape}artisan{$escape} {$escape}queue:work{$escape} {$escape}connection{$escape} {$escape}--once{$escape} {$escape}--queue=queue{$escape} {$escape}--delay=1{$escape} {$escape}--memory=2{$escape} {$escape}--sleep=3{$escape} {$escape}--tries=1{$escape} {$escape}--env=test{$escape}", $process->getCommandLine());
}
public function testMakeProcessCorrectlyFormatsCommandLineWhenTheConnectionIsNotSpecified()
@@ -81,6 +81,6 @@ public function testMakeProcessCorrectlyFormatsCommandLineWhenTheConnectionIsNot
$this->assertInstanceOf(Process::class, $process);
$this->assertEquals(__DIR__, $process->getWorkingDirectory());
$this->assertEquals(3, $process->getTimeout());
- $this->assertEquals($escape.PHP_BINARY.$escape." {$escape}artisan{$escape} {$escape}queue:work{$escape} {$escape}--once{$escape} {$escape}--queue=queue{$escape} {$escape}--delay=1{$escape} {$escape}--memory=2{$escape} {$escape}--sleep=3{$escape} {$escape}--tries=0{$escape} {$escape}--env=test{$escape}", $process->getCommandLine());
+ $this->assertEquals($escape.PHP_BINARY.$escape." {$escape}artisan{$escape} {$escape}queue:work{$escape} {$escape}--once{$escape} {$escape}--queue=queue{$escape} {$escape}--delay=1{$escape} {$escape}--memory=2{$escape} {$escape}--sleep=3{$escape} {$escape}--tries=1{$escape} {$escape}--env=test{$escape}", $process->getCommandLine());
}
} | true |
Other | laravel | framework | 9c5c640d0871924a77a4f7db2b82884fb4227d89.json | Apply suggestions from code review
Co-Authored-By: Dries Vints <dries.vints@gmail.com> | src/Illuminate/Foundation/Testing/TestResponse.php | @@ -676,9 +676,11 @@ public function assertJsonValidationErrors($errors)
if (! is_int($key)) {
$hasError = false;
+
foreach (Arr::wrap($jsonErrors[$key]) as $jsonErrorMessage) {
if (Str::contains($jsonErrorMessage, $value)) {
$hasError = true;
+
break;
}
} | false |
Other | laravel | framework | 706e4640221804bc9615025753ce4c7ce5de51b8.json | Improve code to break early | src/Illuminate/Foundation/Testing/TestResponse.php | @@ -679,6 +679,7 @@ public function assertJsonValidationErrors($errors)
foreach (Arr::wrap($jsonErrors[$key]) as $jsonErrorMessage) {
if (Str::contains($jsonErrorMessage, $value)) {
$hasError = true;
+ break;
}
}
| false |
Other | laravel | framework | 9d8c11d5190e81b879f1b2bfdb4f4acfe9d94b88.json | Fix coding style | src/Illuminate/Foundation/Testing/TestResponse.php | @@ -682,9 +682,9 @@ public function assertJsonValidationErrors($errors)
}
}
- if (!$hasError) {
+ if (! $hasError) {
PHPUnit::fail(
- "Failed to find a validation error in the response for key and message: '$key' => '$value'" . PHP_EOL . PHP_EOL . $errorMessage
+ "Failed to find a validation error in the response for key and message: '$key' => '$value'".PHP_EOL.PHP_EOL.$errorMessage
);
}
} | false |
Other | laravel | framework | 2f803194545b122b1b2646be82793e9e99f97baa.json | Fix worker timeout handler for null `$job`
The queue worker timeout handler may be called with a null `$job` if the
timeout is reached when there is no job processing (perhaps it took too long
to fetch the next job in the worker loop). This fix checks to make sure there
is a job before attempting to mark the as failed if it will exceed the maximum
number of attempts. | src/Illuminate/Queue/Worker.php | @@ -140,9 +140,11 @@ protected function registerTimeoutHandler($job, WorkerOptions $options)
// process if it is running too long because it has frozen. This uses the async
// signals supported in recent versions of PHP to accomplish it conveniently.
pcntl_signal(SIGALRM, function () use ($job, $options) {
- $this->markJobAsFailedIfWillExceedMaxAttempts(
- $job->getConnectionName(), $job, (int) $options->maxTries, $this->maxAttemptsExceededException($job)
- );
+ if ($job) {
+ $this->markJobAsFailedIfWillExceedMaxAttempts(
+ $job->getConnectionName(), $job, (int) $options->maxTries, $this->maxAttemptsExceededException($job)
+ );
+ }
$this->kill(1);
}); | false |
Other | laravel | framework | e558d8b5d91276fa377b5da46ebc072f8a3ac226.json | Fix some docblocks params. | src/Illuminate/Database/Eloquent/Relations/Concerns/AsPivot.php | @@ -203,7 +203,7 @@ public function setPivotKeys($foreignKey, $relatedKey)
/**
* Determine if the pivot model or given attributes has timestamp attributes.
*
- * @param $attributes array|null
+ * @param array|null $attributes
* @return bool
*/
public function hasTimestampAttributes($attributes = null) | true |
Other | laravel | framework | e558d8b5d91276fa377b5da46ebc072f8a3ac226.json | Fix some docblocks params. | src/Illuminate/Redis/Connections/PhpRedisConnection.php | @@ -149,7 +149,7 @@ public function hsetnx($hash, $key, $value)
*
* @param string $key
* @param int $count
- * @param $value $value
+ * @param mixed $value
* @return int|false
*/
public function lrem($key, $count, $value) | true |
Other | laravel | framework | e558d8b5d91276fa377b5da46ebc072f8a3ac226.json | Fix some docblocks params. | tests/Http/HttpJsonResponseTest.php | @@ -15,7 +15,7 @@ class HttpJsonResponseTest extends TestCase
/**
* @dataProvider setAndRetrieveDataProvider
*
- * @param $data
+ * @param mixed $data
*/
public function testSetAndRetrieveData($data): void
{ | true |
Other | laravel | framework | e558d8b5d91276fa377b5da46ebc072f8a3ac226.json | Fix some docblocks params. | tests/Queue/RedisQueueIntegrationTest.php | @@ -68,7 +68,7 @@ public function testExpiredJobsArePopped($driver)
/**
* @dataProvider redisDriverProvider
*
- * @param $driver
+ * @param mixed $driver
*
* @throws \Exception
*/ | true |
Other | laravel | framework | 1e4486ad7e95929c7c4adda0c85273dc5cc4e150.json | Use pure class name (stdClass) | tests/Auth/AuthAccessGateTest.php | @@ -63,7 +63,7 @@ public function test_before_can_allow_guests()
$gate = new Gate(new Container, function () {
});
- $gate->before(function (?StdClass $user) {
+ $gate->before(function (?stdClass $user) {
return true;
});
@@ -75,7 +75,7 @@ public function test_after_can_allow_guests()
$gate = new Gate(new Container, function () {
});
- $gate->after(function (?StdClass $user) {
+ $gate->after(function (?stdClass $user) {
return true;
});
@@ -87,11 +87,11 @@ public function test_closures_can_allow_guest_users()
$gate = new Gate(new Container, function () {
});
- $gate->define('foo', function (?StdClass $user) {
+ $gate->define('foo', function (?stdClass $user) {
return true;
});
- $gate->define('bar', function (StdClass $user) {
+ $gate->define('bar', function (stdClass $user) {
return false;
});
@@ -148,19 +148,19 @@ public function test_before_and_after_callbacks_can_allow_guests()
$gate = new Gate(new Container, function () {
});
- $gate->before(function (?StdClass $user) {
+ $gate->before(function (?stdClass $user) {
$_SERVER['__laravel.gateBefore'] = true;
});
- $gate->after(function (?StdClass $user) {
+ $gate->after(function (?stdClass $user) {
$_SERVER['__laravel.gateAfter'] = true;
});
- $gate->before(function (StdClass $user) {
+ $gate->before(function (stdClass $user) {
$_SERVER['__laravel.gateBefore2'] = true;
});
- $gate->after(function (StdClass $user) {
+ $gate->after(function (stdClass $user) {
$_SERVER['__laravel.gateAfter2'] = true;
});
@@ -818,7 +818,7 @@ class AccessGateTestGuestNullableInvokable
{
public static $calledMethod = null;
- public function __invoke(?StdClass $user)
+ public function __invoke(?stdClass $user)
{
static::$calledMethod = 'Nullable __invoke was called';
@@ -961,12 +961,12 @@ public function update($user, AccessGateTestDummy $dummy)
class AccessGateTestPolicyThatAllowsGuests
{
- public function before(?StdClass $user)
+ public function before(?stdClass $user)
{
$_SERVER['__laravel.testBefore'] = true;
}
- public function edit(?StdClass $user, AccessGateTestDummy $dummy)
+ public function edit(?stdClass $user, AccessGateTestDummy $dummy)
{
return true;
}
@@ -979,12 +979,12 @@ public function update($user, AccessGateTestDummy $dummy)
class AccessGateTestPolicyWithNonGuestBefore
{
- public function before(StdClass $user)
+ public function before(stdClass $user)
{
$_SERVER['__laravel.testBefore'] = true;
}
- public function edit(?StdClass $user, AccessGateTestDummy $dummy)
+ public function edit(?stdClass $user, AccessGateTestDummy $dummy)
{
return true;
} | false |
Other | laravel | framework | 5deeb7febb93729cc43a96b3c0218be347af132f.json | Remove temporary variable | src/Illuminate/Http/Request.php | @@ -422,16 +422,14 @@ public static function createFromBase(SymfonyRequest $request)
return $request;
}
- $content = $request->content;
-
$newRequest = (new static)->duplicate(
$request->query->all(), $request->request->all(), $request->attributes->all(),
$request->cookies->all(), $request->files->all(), $request->server->all()
);
$newRequest->headers->replace($request->headers->all());
- $newRequest->content = $content;
+ $newRequest->content = $request->content;
$newRequest->request = $newRequest->getInputSource();
| false |
Other | laravel | framework | 3702636d8c2bb0b2aadbd85ec9ddf122d85a7b6a.json | Fix version constraints | src/Illuminate/Cache/composer.json | @@ -16,7 +16,7 @@
"require": {
"php": "^7.2",
"illuminate/contracts": "^6.0",
- "illuminate/support": "^6.0*"
+ "illuminate/support": "^6.0"
},
"autoload": {
"psr-4": { | true |
Other | laravel | framework | 3702636d8c2bb0b2aadbd85ec9ddf122d85a7b6a.json | Fix version constraints | src/Illuminate/Queue/composer.json | @@ -16,7 +16,7 @@
"require": {
"php": "^7.2",
"ext-json": "*",
- "illuminate/console": "^6.0*",
+ "illuminate/console": "^6.0",
"illuminate/container": "^6.0",
"illuminate/contracts": "^6.0",
"illuminate/database": "^6.0", | true |
Other | laravel | framework | 422754fb7b28fe6c75ee57f1dd476eaadc2a4c40.json | Add assertSessionHasInput to TestResponse | src/Illuminate/Foundation/Testing/TestResponse.php | @@ -913,6 +913,41 @@ public function assertSessionHasAll(array $bindings)
return $this;
}
+ /**
+ * Assert that the session has a given value in the flashed input array.
+ *
+ * @param string|array $key
+ * @param mixed $value
+ * @return $this
+ */
+ public function assertSessionHasInput($key, $value = null)
+ {
+ if (is_array($key)) {
+ foreach ($key as $k => $v) {
+ if (is_int($k)) {
+ $this->assertSessionHasInput($v);
+ } else {
+ $this->assertSessionHasInput($k, $v);
+ }
+ }
+
+ return $this;
+ }
+
+ if (is_null($value)) {
+ PHPUnit::assertTrue(
+ $this->session()->getOldInput($key),
+ "Session is missing expected key [{$key}]."
+ );
+ } elseif ($value instanceof Closure) {
+ PHPUnit::assertTrue($value($this->session()->getOldInput($key)));
+ } else {
+ PHPUnit::assertEquals($value, $this->session()->getOldInput($key));
+ }
+
+ return $this;
+ }
+
/**
* Assert that the session has the given errors.
* | false |
Other | laravel | framework | 38278b29e05680ba5d2f992235c29d317e1c8309.json | Remove 5.7 changelog from master | CHANGELOG-5.7.md | @@ -1,517 +0,0 @@
-# Release Notes for 5.7.x
-
-## [Unreleased](https://github.com/laravel/framework/compare/v5.7.28...5.7)
-
-
-## [v5.7.28 (2019-02-26)](https://github.com/laravel/framework/compare/v5.7.27...v5.7.28)
-
-### Added
-- Add support for `Pheanstalk 4.x` ([#27622](https://github.com/laravel/framework/pull/27622))
-- Allow configuration of token guard keys ([#27585](https://github.com/laravel/framework/pull/27585))
-
-### Changed
-- Update vue preset to exclude `@babel/preset-react` ([#27645](https://github.com/laravel/framework/pull/27645))
-- Reflash the session for the broadcasting auth call ([#27647](https://github.com/laravel/framework/pull/27647))
-- Improving readability in `AuthenticateWithBasicAuth` Middleware ([#27661](https://github.com/laravel/framework/pull/27661))
-- Use safe container getter on `Pipeline` ([#27648](https://github.com/laravel/framework/pull/27648))
-
-### Fixed
-- Fixed Postgres grammar when using union queries ([#27589](https://github.com/laravel/framework/pull/27589))
-- Fixed an issue when using Mail::queue to queue Mailables ([#27618](https://github.com/laravel/framework/pull/27618))
-- Fixed error in `Foundation\Exceptions\Handler` ([#27632](https://github.com/laravel/framework/pull/27632))
-
-
-## [v5.7.26 (2019-02-12)](https://github.com/laravel/framework/compare/v5.7.25...v5.7.26)
-
-### Added
-- Added `Illuminate\Pipeline\Pipeline::thenReturn()` ([#27429](https://github.com/laravel/framework/pull/27429))
-- Added `Illuminate\Cache\TaggedCache::getTags()` ([#27445](https://github.com/laravel/framework/pull/27445))
-- Added `Illuminate\Http\ResponseTrait::getCallback()` ([#27464](https://github.com/laravel/framework/pull/27464))
-- Added license file to each component ([9e57e8b](https://github.com/laravel/framework/commit/9e57e8bea04638d5bafec62db1051fbc2ce39e3a))
-- Added `Model::withoutEvents()` method ([#27419](https://github.com/laravel/framework/pull/27419), [5c5d6b2](https://github.com/laravel/framework/commit/5c5d6b24f6156768575ae49aa84d7b1d004f23fe))
-
-### Reverted
-- Revert of "Fixed wrong class being used when eager loading nullable `MorphTo` with `withDefault()` ([#27411](https://github.com/laravel/framework/pull/27411))"([9bbf644](https://github.com/laravel/framework/commit/9bbf6443e2709d846367f04ebed9a41823ebcc34))
-
-### Changed
-- Improved error message in `Illuminate\Foundation\Testing\TestResponse::assertJsonValidationErrors()` ([#27495](https://github.com/laravel/framework/pull/27495), [98010da](https://github.com/laravel/framework/commit/98010da996de264c1487bbd1c145741169691b95))
-- `Illuminate\Support\Testing\Fakes\EventFake::dispatch()` will return response ([#27430](https://github.com/laravel/framework/pull/27430))
-
-
-## [v5.7.25 (2019-02-05)](https://github.com/laravel/framework/compare/v5.7.24...v5.7.25)
-
-### Added
-- Allowed specifying custom translation for date relative messages ([#27341](https://github.com/laravel/framework/pull/27341))
-- Add computed support to SQL Server schema grammar ([#27346](https://github.com/laravel/framework/pull/27346), [1c74d7f](https://github.com/laravel/framework/commit/1c74d7fe595df223279de55dffc7ae6fc8ac9ca6))
-- Allowed `ENV` to control paths of `cache files` for `services`, `packages` and `routes` ([#27389](https://github.com/laravel/framework/pull/27389))
-
-### Fixed
-- Fixed `BelongsToMany` pivot relationship child with loaded relations wakeup ([#27358](https://github.com/laravel/framework/pull/27358))
-- Fixed wrong class being used when eager loading nullable `MorphTo` with `withDefault()` ([#27411](https://github.com/laravel/framework/pull/27411))
-
-### Changed
-- Removed `php_network_getaddresses: getaddrinfo failed: Name or service not known` in `DetectsLostConnections` trait ([#27418](https://github.com/laravel/framework/pull/27418))
-
-
-## [v5.7.24 (2019-01-30)](https://github.com/laravel/framework/compare/v5.7.23...v5.7.24)
-
-### Fixed
-- Fixed `ResetPassword` notification ([#27351](https://github.com/laravel/framework/pull/27351), [b130771](https://github.com/laravel/framework/commit/b13077164bc6b4cb032b9eec7f5209402b5260eb))
-
-
-## [v5.7.23 (2019-01-29)](https://github.com/laravel/framework/compare/v5.7.22...v5.7.23)
-
-### Added
-- Added `AbstractPaginator::getOptions()` method ([#27273](https://github.com/laravel/framework/pull/27273))
-- Added `Communication link failure` to `DetectsLostConnections` trait ([#27307](https://github.com/laravel/framework/pull/27307))
-- Added `orWhere()` `proxy` for `scopes` to `EloquentBuilder` ([#27281](https://github.com/laravel/framework/pull/27281), [2e6fe85](https://github.com/laravel/framework/commit/2e6fe855c7d7d9d3cbf34e1fbea17c8059640c5c))
-- Allow the `app path` to be configured ([#27332](https://github.com/laravel/framework/pull/27332), [d73e672](https://github.com/laravel/framework/commit/d73e6729cefb26c2fbcb16e47daefc2ba86b9697))
-- Added config for using `WhatFailureGroupHandler` when `StackDriver` created for Logger ([#27308](https://github.com/laravel/framework/pull/27308) ,[6a92651](https://github.com/laravel/framework/commit/6a926519e8e3905013569e7b3fcdd598ec7cece3))
-
-### Fixed
-- Fixed `QueueableCollection` serialization of Eloquent Models when using `Binary IDs` ([#27271](https://github.com/laravel/framework/pull/27271))
-- Replaced `newModelQuery()` with `newQueryWithoutRelationships()` for `UPDATE`/`DELETE` queries ([#27277](https://github.com/laravel/framework/pull/27277))
-
-### Changed
-- Apply parameters to entire localization array ([#27254](https://github.com/laravel/framework/pull/27254))
-- Added line about expiring password reset in notification email ([#27324](https://github.com/laravel/framework/pull/27324), [80c5aec](https://github.com/laravel/framework/commit/80c5aecb443e7a55e868b66b9e0a93b7dfec08e8))
-- "Go Home" link will redirect to the `home` route on exception page ([#27343](https://github.com/laravel/framework/pull/27343))
-
-
-## [v5.7.22 (2019-01-22)](https://github.com/laravel/framework/compare/v5.7.21...v5.7.22)
-
-### Fixed
-- Fixed `TestResponse::assertJsonValidationErrors()` when there are no errors ([#27190](https://github.com/laravel/framework/pull/27190))
-
-### Changed
-- Allowed `TestResponse::assertJsonMissingValidationErrors()` to be called without an argument ([#27176](https://github.com/laravel/framework/pull/27176))
-- Updated vue preset's vue-stubs for laravel-mix 4 compatibility ([#27229](https://github.com/laravel/framework/pull/27229))
-- Updated preset to use `@babel/preset-react` ([#27235](https://github.com/laravel/framework/pull/27235))
-- Used `config` to resolve the database value during tests. ([#27240](https://github.com/laravel/framework/pull/27240))
-
-
-## [v5.7.21 (2019-01-15)](https://github.com/laravel/framework/compare/v5.7.20...v5.7.21)
-
-### Fixed
-- Fixed `Blueprint::removeColumn()` ([#27115](https://github.com/laravel/framework/pull/27115), [#27122](https://github.com/laravel/framework/pull/27122))
-- Fixed allowing of null broadcast connection driver ([#27135](https://github.com/laravel/framework/pull/27135))
-- Fixed `ModelMakeCommand::handle()` should always return `bool` value ([#27156](https://github.com/laravel/framework/pull/27156))
-- Fixed `TestResponse::assertSessionDoesntHaveErrors()` when there are no errors ([#27145](https://github.com/laravel/framework/pull/27145))
-- Fixed default message is localization twice in `403.blade.php` error page ([4a08120](https://github.com/laravel/framework/commit/4a081204d65a6e01959d795e71770079588bad21))
-
-### Changed
-- Replaced `get_called_class()` to `static::class` ([#27146](https://github.com/laravel/framework/pull/27146))
-- Re-throw `NoMatchingExpectationException` from `PendingCommand` ([#27158](https://github.com/laravel/framework/pull/27158))
-
-
-## [v5.7.20 (2019-01-08)](https://github.com/laravel/framework/compare/v5.7.19...v5.7.20)
-
-### Added
-- Added `chunkById` support in relations ([#26919](https://github.com/laravel/framework/pull/26919))
-- Added `Collection::whereNotBetween` method ([#27028](https://github.com/laravel/framework/pull/27028))
-- Allowed predefined log channels to change formatter from config ([#26895](https://github.com/laravel/framework/pull/26895))
-- Allowed storage assertions (`FilesystemAdapter::assertExists` / `FilesystemAdapter::assertMissing`) to handle multiple files at once ([#26975](https://github.com/laravel/framework/pull/26975))
-- Added `Adaptive Server connection failed` to `DetectsLostConnections` trait ([#27055](https://github.com/laravel/framework/pull/27055))
-- Added `Route::originalParameters()` ([#27056](https://github.com/laravel/framework/pull/27056))
-- Added `QueueFake::pushedJobs()` ([#27089](https://github.com/laravel/framework/pull/27089), [695ffa1](https://github.com/laravel/framework/commit/695ffa1247a7a44a79ba85442ad9ea311413feae))
-
-### Fixed
-- Prevents unnecessary queries when lazy loading empty relationships ([#26992](https://github.com/laravel/framework/pull/26992))
-- Fixed broken `Command::setHidden` method ([#27005](https://github.com/laravel/framework/pull/27005))
-- Fixed `Str::slug` method ([#27002](https://github.com/laravel/framework/pull/27002))
-- Ignore `--seed` option for `artisan migrate --pretend` ([#27015](https://github.com/laravel/framework/pull/27015))
-- Fixed `previousUrl` in the session if the call is `prefetch` ([#27017](https://github.com/laravel/framework/pull/27017))
-- Fixed nullable `MorphTo` touching ([#27031](https://github.com/laravel/framework/pull/27031))
-- Fixed `Collection::loadMissing()` with duplicate relation names ([#27040](https://github.com/laravel/framework/pull/27040))
-- Fixed some commands ([#27020](https://github.com/laravel/framework/pull/27020))
-- Ensured the command `context` is forwarded to calls ([#27012](https://github.com/laravel/framework/pull/27012), [#27065](https://github.com/laravel/framework/pull/27065))
-- Fixed `Collection::loadMorph()` issue relations loading issue ([#27081](https://github.com/laravel/framework/pull/27081))
-
-### Changed
-- Removed `HasOneOrMany::update()` since `Builder::update()` already adds the `UPDATED_AT` timestamp. ([#27026](https://github.com/laravel/framework/pull/27026))
-- Changed `Name or service not known` to `php_network_getaddresses: getaddrinfo failed: Name or service not known` in `DetectsLostConnections` trait ([#27054](https://github.com/laravel/framework/pull/27054), [5459ac1](https://github.com/laravel/framework/commit/5459ac15b56cdee8e176827ddbb30357119ceabb))
-- Changed Eloquent `ApiResource merge()` methods to accept `JsonResource` object ([#27068](https://github.com/laravel/framework/pull/27068))
-- Stop email re-verification with same link ([#27070](https://github.com/laravel/framework/pull/27070))
-
-
-## [v5.7.19 (2018-12-18)](https://github.com/laravel/framework/compare/v5.7.18...v5.7.19)
-
-### Added
-- Added `Illuminate\Support\Collection::whereBetween` method ([#26888](https://github.com/laravel/framework/pull/26888))
-
-### Fixed
-- <strong> Reverted changes related to [`app()->call()`](https://github.com/laravel/framework/pull/26852) </strong> ([fefaf46](https://github.com/laravel/framework/commit/fefaf46dd147a4caf1dea1712f9797f3db49fea4))
-- Reset doctrineConnection property on Database/Connection when reconnecting ([#26890](https://github.com/laravel/framework/pull/26890))
-
-
-## [v5.7.18 (2018-12-17)](https://github.com/laravel/framework/compare/v5.7.17...v5.7.18)
-
-### Added
-- Added missing `starts_with` validation message ([#26822](https://github.com/laravel/framework/pull/26822))
-- Added `Facade::resolved()` method to register pending callback until the service is available. ([#26824](https://github.com/laravel/framework/pull/26824))
-- Added env var `APP_CONFIG_CACHE` to control cache config path ([578bc83](https://github.com/laravel/framework/commit/578bc83f0247b97ec87fefe39a8da7e9bbfd4a66))
-
-### Changed
-- Changed `TransportManager::createMailDriver` ([#26846](https://github.com/laravel/framework/pull/26846))
-
-### Fixed
-- Fixed of using `illuminate/mail` outside of Laravel with driver log ([#26842](https://github.com/laravel/framework/pull/26842))
-- Fixed some bugs for `app()->call()` ([#26852](https://github.com/laravel/framework/pull/26852))
-- Added workaround for PHP-bug related to [incorrect variable values when Opcache enabled in PHP v 7.3.0](https://github.com/laravel/framework/issues/26819) ([36d3436](https://github.com/laravel/framework/commit/36d343682d25570946ff22397a720727e0c1dcd7))
-
-
-## [v5.7.17 (2018-12-12)](https://github.com/laravel/framework/compare/v5.7.16...v5.7.17)
-
-### Added
-- Added `Database\Query\Builder::insertUsing` method ([#26732](https://github.com/laravel/framework/pull/26732), [8216b46](https://github.com/laravel/framework/commit/8216b4607152f9b01f26efba6b045add5382c625))
-- Added `Database\Query\Builder::havingBetween` method ([#26758](https://github.com/laravel/framework/pull/26758))
-- Added `Packets out of order. Expected` string to `DetectsLostConnections` trait ([#26760](https://github.com/laravel/framework/pull/26760))
-- Added `NOT VALID` option for skipping validation when adding postgres foreign keys ([#26775](https://github.com/laravel/framework/pull/26775))
-
-### Fixed
-- Fixed: Using `store` on an uploaded file when you push an empty file ([#26809](https://github.com/laravel/framework/pull/26809))
-- Fixed hiding for hidden commands ([#26781](https://github.com/laravel/framework/pull/26781))
-
-
-## [v5.7.16 (2018-12-05)](https://github.com/laravel/framework/compare/v5.7.15...v5.7.16)
-
-### Added
-- Added localization for `403.blade.php` and `503.blade.php` ([#26751](https://github.com/laravel/framework/pull/26751))
-- Changing the Migrator to accept not only migration directory paths, but migration file paths too ([#26642](https://github.com/laravel/framework/pull/26642), [c4b13bf](https://github.com/laravel/framework/commit/c4b13bfd115bcfd54588ad2a5809fea2222d1cdb))
-
-### Fixed
-- Fixed self-referencing HasManyThrough existence queries ([#26662](https://github.com/laravel/framework/pull/26662))
-- Fixed HasManyThrough existence queries with same parent and through parent table ([#26676](https://github.com/laravel/framework/pull/26676))
-- Fixed breaking eager loading with "incrementing" string keys ([#26688](https://github.com/laravel/framework/pull/26688))
-- Remove the Register `<li>` when the route doesn't exist in `app.stub` ([#26708](https://github.com/laravel/framework/pull/26708))
-- Fixed `Collection::some` method ([#26696](https://github.com/laravel/framework/pull/26696))
-- <strong> Revert breaking change in `TestResponse::decodeResponseJson` method </strong> ([#26713](https://github.com/laravel/framework/pull/26713))
-- Fixed `PhpRedisConnection::mget` ([#26716](https://github.com/laravel/framework/pull/26716))
-- Fixed `Eloquent\Collection::loadCount` attribute syncing ([#26714](https://github.com/laravel/framework/pull/26714))
-- Fixed `Illuminate\Foundation\Testing\Concerns\InteractsWithDatabase::seed` for array accepting ([#26734](https://github.com/laravel/framework/pull/26734))
-- Fixed `FormRequest` validation triggering twice ([#26731](https://github.com/laravel/framework/pull/26731))
-
-### Changed
-- Changed markdown on auth stub view (`Auth/Console/stubs/make/views/auth/login.stub`) ([#26648](https://github.com/laravel/framework/pull/26648))
-- Moved Slack and Nexmo notification channels to the own packages `laravel/nexmo-notification-channel`, `laravel/slack-notification-channel` ([#26689](https://github.com/laravel/framework/pull/26689), [#26727](https://github.com/laravel/framework/pull/26727))
-
-### Deprecated
-- `$cachedSchema` property in `UrlGenerator` is deprecated. Will be renamed to the `$cachedScheme` in 5.8 ([#26640](https://github.com/laravel/framework/pull/26640))
-
-
-## [v5.7.15 (2018-11-26)](https://github.com/laravel/framework/compare/v5.7.14...v5.7.15)
-
-### Added
-- Added `date_equals` validation message ([#26584](https://github.com/laravel/framework/pull/26584))
-- Added `starts_with` validation rule ([#26612](https://github.com/laravel/framework/pull/26612))
-- Added relationship getters `BelongsToMany::getParentKeyName`, `BelongsToMany::getRelatedKeyName`, `HasManyThrough::getFirstKeyName`, `HasManyThrough::getForeignKeyName`, `HasManyThrough::getSecondLocalKeyName`, `HasOneOrMany::getLocalKeyName`, `MorphToMany::getInverse` ([#26607](https://github.com/laravel/framework/pull/26607))
-- Make `ResourceCollection` countable ([#26595](https://github.com/laravel/framework/pull/26595))
-
-### Fixed
-- Fixed duplicate validation issue in `FormRequest::validated` method ([#26604](https://github.com/laravel/framework/pull/26604))
-- <strong> Prevent breaking eager loading with string keys </strong> ([#26622](https://github.com/laravel/framework/pull/26622))
-
-
-## [v5.7.14 (2018-11-21)](https://github.com/laravel/framework/compare/v5.7.13...v5.7.14)
-
-### Added
-- Added `Macroable` trait to `Illuminate\Cookie\CookieJar` ([#26445](https://github.com/laravel/framework/pull/26445))
-- Added ability to disable password reset route ([#26459](https://github.com/laravel/framework/pull/26459))
-- Added ability to publish error views ([#26460](https://github.com/laravel/framework/pull/26460))
-- Added ability to set notifcation tries and timeout ([#26493](https://github.com/laravel/framework/pull/26493))
-- Added `mail.log_channel` config for make `log` for mail driver configurable ([#26510](https://github.com/laravel/framework/pull/26510))
-- Allowed `asset` root urls to be configurable via `app.asset_url` ([9172a67](https://github.com/laravel/framework/commit/9172a67b783952c1d3e15452d9c8646dc0b3eb6d))
-- Added `Error while sending QUERY packet` string to `DetectsLostConnections` trait ([#26233](https://github.com/laravel/framework/pull/26560))
-- Added env override for running in console ([a36906a](https://github.com/laravel/framework/commit/a36906ab8a141f1f497a0667196935e41970ae51), [19f2245](https://github.com/laravel/framework/commit/19f2245c6d7c87daf784f94b169f0dd4d98f0ca4))
-
-### Fixed
-- Fixed `UNION` aggregate queries with columns ([#26466](https://github.com/laravel/framework/pull/26466))
-- Allowed migration table name to be guessed without `_table` suffix ([#26429](https://github.com/laravel/framework/pull/26429))
-- Fixed `TestResponse::assertExactJson` for empty JSON objects ([#26353](https://github.com/laravel/framework/pull/26353), [e6ebc8d](https://github.com/laravel/framework/commit/e6ebc8d239e53e6daf16c869de3897ffbce6c751), [621d91d](https://github.com/laravel/framework/commit/621d91d802016ab4a64acc5c65f81cb9f5e5f779), [#26508](https://github.com/laravel/framework/pull/26508))
-- Fixed cache repository for PHP from 7.2.12v ([#26495]( https://github.com/laravel/framework/pull/26495))
-- Fixed user authorization check for Email Verification ([#26528](https://github.com/laravel/framework/pull/26528))
-- Fixed nested JOINs on SQLite ([#26567](https://github.com/laravel/framework/pull/26567))
-
-### Changed
-- Improved eager loading performance ([#26434](https://github.com/laravel/framework/pull/26434), [#26453](https://github.com/laravel/framework/pull/26453), [3992140](https://github.com/laravel/framework/commit/3992140064307ef82d23328995e7c59045c231f2), [#26471](https://github.com/laravel/framework/pull/26471), [a3738cf](https://github.com/laravel/framework/commit/a3738cf4e133a4475c56b51f521a12db78e2ecbb), [#26531](https://github.com/laravel/framework/pull/26531))
-- Adjusted `mix` missing asset exceptions ([#26431](https://github.com/laravel/framework/pull/26431))
-- Used `asset` helper to generate full path urls in exception views ([#26411](https://github.com/laravel/framework/pull/26411))
-- Changed `Illuminate\Foundation\Testing\Concerns\MocksApplicationServices::withoutJobs` method ([#26437](https://github.com/laravel/framework/pull/26437))
-- Cached `distinct` validation rule data ([#26509](https://github.com/laravel/framework/pull/26509))
-- Improved DNS Prefetching in view files ([#26552](https://github.com/laravel/framework/pull/26552))
-
-
-## [v5.7.13 (2018-11-07)](https://github.com/laravel/framework/compare/v5.7.12...v5.7.13)
-
-### Added
-- Added ability to return an array of messages in a custom validation rule ([#26327](https://github.com/laravel/framework/pull/26327))
-- Added `whenEmpty`/ `whenNotEmpty` / `unlessEmpty` / `unlessNotEmpty` methods to `Collection` ([#26345](https://github.com/laravel/framework/pull/26345))
-- Added `Illuminate\Support\Collection::some` method ([#26376](https://github.com/laravel/framework/pull/26376), [8f7e647](https://github.com/laravel/framework/commit/8f7e647dcee5fe13d7fc33a1e0e1ce531ea9f49e))
-- Added `Illuminate\Cache\Repository::missing` method ([#26351](https://github.com/laravel/framework/pull/26351))
-- Added `Macroable` trait to `Illuminate\View\Factory` ([#26361](https://github.com/laravel/framework/pull/26361))
-- Added support for UNION aggregate queries ([#26365](https://github.com/laravel/framework/pull/26365))
-
-### Changed
-- Updated `AbstractPaginator::appends` to handle null ([#26326](https://github.com/laravel/framework/pull/26326))
-- Added "guzzlehttp/guzzle": "^6.3", to `composer.json` ([#26328](https://github.com/laravel/framework/pull/26328))
-- Showed exception message on 403 error page when message is available ([#26356](https://github.com/laravel/framework/pull/26356))
-- Don't run TransformsRequest twice on ?query= parameters ([#26366](https://github.com/laravel/framework/pull/26366))
-- Added missing logging options to slack log driver ([#26360](https://github.com/laravel/framework/pull/26360))
-- Use cascade when truncating table in PostgreSQL ([#26389](https://github.com/laravel/framework/pull/26389))
-- Allowed pass absolute parameter in has valid signature request macro ([#26397](https://github.com/laravel/framework/pull/26397))
-
-### Changed realization
-- Used `Request::validate` macro in Auth traits ([#26314](https://github.com/laravel/framework/pull/26314))
-
-
-## [v5.7.12 (2018-10-30)](https://github.com/laravel/framework/compare/v5.7.11...v5.7.12)
-
-### Added
-- Added `CacheManager::forgetDriver` method ([#26264](https://github.com/laravel/framework/pull/26264), [fd9ef49](https://github.com/laravel/framework/commit/fd9ef492faefff96deab5285e30bc1b675211bcb))
-- Added `Illuminate\Foundation\Http\Kernel::getMiddlewareGroups` method ([#26268](https://github.com/laravel/framework/pull/26268))
-- Added an sqlite config option (`foreign_key_constraints`) to enable / disable foreign key constraints ([#26298](https://github.com/laravel/framework/pull/26298), [674f8be](https://github.com/laravel/framework/commit/674f8befc57f1e9fe8d064b475903431de39f41c), [#26306](https://github.com/laravel/framework/pull/26306))
-
-### Fixed
-- Checked `$absolute` parameter in `UrlGenerator::signedRoute` ([#26265](https://github.com/laravel/framework/pull/26265))
-- Fixed error in resource building after running `php artisan preset none` command ([41becda](https://github.com/laravel/framework/pull/26244/commits/41becda26a6bfcfaf9754beb9106b6ca0f328a61), [#26244](https://github.com/laravel/framework/pull/26244))
-- Fixed `whereDoesntHave()` and `doesntHave()` with nested relationships ([#26228](https://github.com/laravel/framework/pull/26228))
-- Fixed filesystem locking hangs in `PackageManifest::build()` ([#26254](https://github.com/laravel/framework/pull/26254))
-
-### Changed
-- Made expectation closure optional for `InteractsWithContainer::mock` and `InteractsWithContainer::spy` ([#26242](https://github.com/laravel/framework/pull/26242))
-- Allowed multiple `createPayloadCallback` on queues ([#26250](https://github.com/laravel/framework/pull/26250), [6e3d568](https://github.com/laravel/framework/commit/6e3d568757a8e4124b49bf9ac94f1db7a66437a1))
-- Changed wording on default 403 view ([#26258](https://github.com/laravel/framework/pull/26258))
-- Bump `vue.js` to `^2.5.17` in `artisan preset vue` command ([89f56bf](https://github.com/laravel/framework/pull/26244/commits/89f56bf8f9abb310bf985045c13103cb73a40351), [#26244](https://github.com/laravel/framework/pull/26244))
-- Allowed adding additional `$manyMethods` when extending the model class ([#26307](https://github.com/laravel/framework/pull/26307))
-
-
-## [v5.7.11 (2018-10-24)](https://github.com/laravel/framework/compare/v5.7.10...v5.7.11)
-
-### Added
-- Added `decimal:<num>` cast to Model ([#26173](https://github.com/laravel/framework/pull/26173))
-- Allowed updateExistingPivot to receive an arrayable item ([#26167](https://github.com/laravel/framework/pull/26167))
-- Added `setIntendedUrl` method to `Routing/Redirector.php` ([#26227](https://github.com/laravel/framework/pull/26227))
-- Added `ORA-03114` string to `DetectsLostConnections` trait ([#26233](https://github.com/laravel/framework/pull/26233))
-
-### Fixed
-- Fixed an issue where the worker process would not be killed by the listener when the timeout is exceeded ([#25981](https://github.com/laravel/framework/pull/25981))
-
-### Changed
-- Reverted filesystem changes which were done in [#26010](https://github.com/laravel/framework/pull/26010) ([#26231](https://github.com/laravel/framework/pull/26231))
-
-
-## [v5.7.10 (2018-10-23)](https://github.com/laravel/framework/compare/v5.7.9...v5.7.10)
-
-### Added
-- Added loadCount method to eloquent collections ([#25997](https://github.com/laravel/framework/pull/25997))
-- Added support for identity columns in PostgreSQL 10+ ([#26096](https://github.com/laravel/framework/pull/26096))
-- Allowed passing a model instance directly to `assertSoftDeleted` method in `Foundation/Testing/Concerns/InteractsWithDatabase.php` ([#26133](https://github.com/laravel/framework/pull/26133) , [#26148](https://github.com/laravel/framework/pull/26148))
-- Added possibility to define exclude methods on registered `apiResource` ([#26149](https://github.com/laravel/framework/pull/26149))
-- Added `filp/whoops` to `suggest` in `composer.json` ([#26180](https://github.com/laravel/framework/pull/26180))
-- Added `mock` and `spy` methods to `Foundation/Testing/Concerns/InteractsWithContainer.php` ([#26171](https://github.com/laravel/framework/pull/26171), [b50f9f3](https://github.com/laravel/framework/commit/b50f9f3bc8c1ee03c22ee8cc0ac37179fb28a1c9))
-- Added `uuid` validation rule to validator ([#26135](https://github.com/laravel/framework/pull/26135))
-- NotificationFake can assert preferred locale ([#26205](https://github.com/laravel/framework/pull/26205))
-
-### Fixed
-- Fixed `whereHas` and `$withCount` bindings from `polymorphic relationships` ([#26145](https://github.com/laravel/framework/pull/26145))
-- Fixed `getTable` method in Model ([#26085](https://github.com/laravel/framework/pull/26085))
-- Fixed filesystem locking hangs in `PackageManifest::build()` ([#26010](https://github.com/laravel/framework/pull/26010), [98b8256](https://github.com/laravel/framework/commit/98b8256f350d468cfc6b9fe2c2b0efb4103810a4))
-- Fixed `Illuminate/Http/Testing/File.php` for Symfony 4.1 components ([#26080](https://github.com/laravel/framework/pull/26080))
-- Fixed URL in `Notifications/resources/views/email.blade.php` ([22ca105](https://github.com/laravel/framework/commit/22ca105c0b1759c95f79e553c1977ffd2a013d05))
-- Fixed `hasValidSignature` method when someone send a `null` signature in `UrlGenerator.php` ([#26132](https://github.com/laravel/framework/pull/26132))
-- Fixed autocomplete for container in ServiceProvider for cases when someone developed packages ([#26063](https://github.com/laravel/framework/pull/26063))
-- Fixed `ColumnDefinition::default` typehint ([#26041](https://github.com/laravel/framework/pull/26041))
-
-### Changed
-- Define mix as const in `react-stubs/webpack.mix.js` and `vue-stubs/webpack.mix.js` presets ([#26119](https://github.com/laravel/framework/pull/26119))
-- Make `assertSessionHasNoErrors` in `TestResponse.php` print the unexpected errors ([#26039](https://github.com/laravel/framework/pull/26039), [e6bdf8a](https://github.com/laravel/framework/commit/e6bdf8af7790db485856ecde0448b353d0cb15ca))
-- Replaced the remaining occurrences of `newQuery()` to `newModelQuery()` in UPDATE/DELETE queries. ([#26158](https://github.com/laravel/framework/pull/26158))
-- Improved `findOrFail()` exceptions in `BelongsToMany.php` and `HasManyThrough.php` relations ([#26182](https://github.com/laravel/framework/pull/26182))
-
-### Changed realization
-- Reversed ternary condition in `Arr::wrap` to make it clearer ([#26150](https://github.com/laravel/framework/pull/26150))
-- Simplified `formatAction` in `UrlGenerator.php` ([#26121](https://github.com/laravel/framework/pull/26121))
-- Simplified `isChainOfObjects` method in `Support/Testing/Fakes/QueueFake.php` ([#26151](https://github.com/laravel/framework/pull/26151))
-- Deleted unneeded code ([#26053](https://github.com/laravel/framework/pull/26053), [#26162](https://github.com/laravel/framework/pull/26162), [#26160](https://github.com/laravel/framework/pull/26160), [#26159](https://github.com/laravel/framework/pull/26159), [#26152](https://github.com/laravel/framework/pull/26152))
-- Prefer stricter comparison ([#26139](https://github.com/laravel/framework/pull/26139), [#26157](https://github.com/laravel/framework/pull/26157))
-- Removed duplicated code from `Router::updateGroupStack` method ([#26206](https://github.com/laravel/framework/pull/26206), [6debff6](https://github.com/laravel/framework/commit/6debff6affba9224c778e32cc3c00e00a66cb9dd))
-
-
-## [v5.7.9 (2018-10-09)](https://github.com/laravel/framework/compare/v5.7.8...v5.7.9)
-
-### Added
-- Support custom user provider names in generator commands ([#25681](https://github.com/laravel/framework/pull/25681))
-- Added 401 Exception view ([#26002](https://github.com/laravel/framework/pull/26002))
-- Added `Categorical imperative` quote to `Inspiring.php` ([#25968](https://github.com/laravel/framework/pull/25968))
-- Mailable `render` method respects `Mailable@locale` property ([#25990](https://github.com/laravel/framework/pull/25990))
-- Added some meta data to the notification mails ([477273c](https://github.com/laravel/framework/commit/477273c72be8b253b6421c69f3e37b5bf4c3a185))
-- Added `Macroable` trait to `PendingResourceRegistration` ([#25947](https://github.com/laravel/framework/pull/25947))
-- Added `assertSessionDoesntHaveErrors` method to `TestResponse.php` ([#25949](https://github.com/laravel/framework/pull/25949), [3005706](https://github.com/laravel/framework/commit/3005706abb411d1468adbff6627ff26351afe446))
-- Enable passing options to custom presets ([#25930](https://github.com/laravel/framework/pull/25930))
-
-### Fixed
-- Fix missing `illuminate/support` dependency in `illuminate/container` ([#25955](https://github.com/laravel/framework/pull/25955))
-- Extend grammar ([#25944](https://github.com/laravel/framework/pull/25944))
-
-### Changed
-- Improved PSR-11 implementation ([#25870](https://github.com/laravel/framework/pull/25870))
-- Changed the sentence of error 403 view from unauthorised to forbidden ([#26002](https://github.com/laravel/framework/pull/26002))
-- Revert email lang template changes ([#25963](https://github.com/laravel/framework/pull/25963))
-- Added model checking in `assertViewHas` ([#26012](https://github.com/laravel/framework/pull/26012))
-
-### Changed realization
-- Inline `Arr::pluck()` in `data_get()` ([#25938](https://github.com/laravel/framework/pull/25938))
-
-## [v5.7.8 (2018-10-04)](https://github.com/laravel/framework/compare/v5.7.7...v5.7.8)
-
-### Added
-- Add `--step` to `migrate:fresh` command ([#25897](https://github.com/laravel/framework/pull/25897))
-- Allow `destroy` method in `Model` to accept a collection of ids ([#25878](https://github.com/laravel/framework/pull/25878))
-- Add AsPivot trait ([#25851](https://github.com/laravel/framework/pull/25851))
-
-### Fixed
-- Fixed wrap table for sql server ([#25896](https://github.com/laravel/framework/pull/25896))
-
-### Changed
-- Use "optimize:clear" in "app:name" command ([#25922](https://github.com/laravel/framework/pull/25922))
-- Revert of "html string support in translator" ([e626ab3](https://github.com/laravel/framework/commit/e626ab32a4afec90f80641fbcd00e6b79d15cd3a))
-
-### Changed (only realization)
-- Simplify code for contextual binding ([e2476c1](https://github.com/laravel/framework/commit/e2476c1cdfeffd1c4432ec8dc1f733815f70c000))
-
-
-## [v5.7.7 (2018-10-02)](https://github.com/laravel/framework/compare/v5.7.6...v5.7.7)
-
-### Added
-- Allow array callables to be passed to Gate::before() ([#25817](https://github.com/laravel/framework/pull/25817))
-- Mail recipient and notifiable can set preferred locale ([#25752](https://github.com/laravel/framework/pull/25752))
-- Always show seeder info ([#25872](https://github.com/laravel/framework/pull/25872))
-- Support JSON UPDATE queries on PostgreSQL ([#25797](https://github.com/laravel/framework/pull/25797))
-- Makes sure changing a database field to JSON does not include a collation ([#25741](https://github.com/laravel/framework/pull/25741))
-- Added Queued Closures ([#25777](https://github.com/laravel/framework/pull/25777))
-- Add the ability to skip algorithm checking ([#25468](https://github.com/laravel/framework/pull/25468), [5fd4b89](https://github.com/laravel/framework/commit/5fd4b899cc42d266fab34ee2d5f92fb47ca34fd0))
-- Add queue create payload hook ([3f68cbe](https://github.com/laravel/framework/commit/3f68cbe3df82990c69e34309901fcefefdb65c95))
-- Authorize Middleware Accept String Parameters ([#25763](https://github.com/laravel/framework/pull/25763))
-
-### Fixed
-- Fix `each` method on BelongsToMany relationships ([#25832](https://github.com/laravel/framework/pull/25832))
-- Fix prefixed table indexes ([#25867](https://github.com/laravel/framework/pull/25867))
-- Fix `be` method in `InteractsWithAuthentication` trait ([#25873](https://github.com/laravel/framework/pull/25873))
-- Fixes the error when $resource is null ([#25838](https://github.com/laravel/framework/pull/25838))
-- Attach all disk attachments and not only first one in the `Mail/Mailable.php` ([#25793](https://github.com/laravel/framework/pull/25793))
-- Fixed: in case if one job throw exception, than we will proceed to next one ([#25820](https://github.com/laravel/framework/pull/25820))
-
-### Changed
-- Trim model class name when passing in `Authorize.php` middleware ([#25849](https://github.com/laravel/framework/pull/25849))
-- Improve JSON UPDATE queries on MySQL ([#25794](https://github.com/laravel/framework/pull/25794))
-- Don't print the generated application key ([#25802](https://github.com/laravel/framework/pull/25802))
-- Improve "exists" validation with array values ([#25819](https://github.com/laravel/framework/pull/25819))
-- Only escape trans parameters ([98046cb](https://github.com/laravel/framework/commit/98046cb0c81b418fb4046ade034f3d33a4172239))
-- Added type check for assertExitCode(0) ([#25847](https://github.com/laravel/framework/pull/25847))
-
-### Changed (only realization)
-- Simplify `save` method `MorphOneOrMany` relation ([#25864](https://github.com/laravel/framework/pull/25864))
-
-
-## [v5.7.6 (2018-09-25)](https://github.com/laravel/framework/compare/v5.7.5...v5.7.6)
-
-### Added
-- Support MorphTo eager loading with selected columns ([#25662](https://github.com/laravel/framework/pull/25662))
-- Added possibility to define a complex condition (overwrite `shouldAddXsrfTokenCookie` method) for add cookie to response in `Middleware/VerifyCsrfToken.php`
-
-### Fixed
-- Fixed tag cache clearing when using Redis ([#25744](https://github.com/laravel/framework/pull/25744))
-- Fixed broken email subcopy template escaping ([#25723](https://github.com/laravel/framework/pull/25723))
-- Fixed MethodNotAllowedHTTPException on Intended Redirect ([#25739](https://github.com/laravel/framework/pull/25739))
-
-### Changed
-- Use url() function instead of plain url in `views/illustrated-layout.blade.php` ([25725](https://github.com/laravel/framework/pull/25725))
-
-
-## [v5.7.5 (2018-09-20)](https://github.com/laravel/framework/compare/v5.7.4...v5.7.5)
-
-### Added
-- Add callback hook for building mailable data in `\Illuminate\Mail\Mailable` ([7dc3d8d](https://github.com/laravel/framework/commit/7dc3d8d35ad8bcd3b18334a44320e3162b9f6dc1))
-
-### Fixed
-- Make any column searchable with `like` in PostgreSQL ([#25698](https://github.com/laravel/framework/pull/25698))
-- Remove trailing newline from hot url in `mix` helper ([#25699](https://github.com/laravel/framework/pull/25699))
-
-### Changed
-- Revert of "Remove `Hash::check()` for password verification" ([2e78bf4](https://github.com/laravel/framework/commit/2e78bf472832cd68ef7d80c73dbb722a62ee1429))
-
-
-## [v5.7.4 (2018-09-18)](https://github.com/laravel/framework/compare/v5.7.3...v5.7.4)
-
-### Added
-- Add 'verified' session boolean in `VerifiesEmails::verify` action ([#25638](https://github.com/laravel/framework/pull/25638))
-- Add Nelson Mandela to Inspirational Quotes ([#25599](https://github.com/laravel/framework/pull/25599))
-- Add `streamedContent` to `TestResponse` class ([#25469](https://github.com/laravel/framework/pull/25469), [b3f583c](https://github.com/laravel/framework/commit/b3f583cd5efbc9e1b9482b00a7c22b00324e936e))
-
-### Fixed
-- Fix app stub when register route option is set to false ([#25582](https://github.com/laravel/framework/pull/25582))
-- Fix artisan PendingCommand run method return value ([#25577](https://github.com/laravel/framework/pull/25577))
-- Support custom accessor on `whenPivotLoaded()` ([#25661](https://github.com/laravel/framework/pull/25661))
-
-### Changed
-- Remove `Hash::check()` for password verification ([#25677](https://github.com/laravel/framework/pull/25677))
-
-
-## [v5.7.3 (2018-09-11)](https://github.com/laravel/framework/compare/v5.7.2...v5.7.3)
-
-### Changed
-- `__toString` method in `Illuminate/Auth/Access/Response.php` ([#25539](https://github.com/laravel/framework/pull/25539))
-- Do not pass the guard instance to the authentication events ([#25568](https://github.com/laravel/framework/pull/25568))
-- Call Pending artisan command immediately ([#25574](https://github.com/laravel/framework/pull/25574), [d54ffa5](https://github.com/laravel/framework/commit/d54ffa594b968b6c9a7cf716f5c73758a7d36824))
-- Use `request()` method when we called Guzzle ClientInterface ([#25490](https://github.com/laravel/framework/pull/25490))
-- Replace all placeholders for comparison rules (`gt`/`gte`/`lt`/`lte`) properly ([#25513](https://github.com/laravel/framework/pull/25513))
-
-### Added
-- Add `storeOutput` method to `Illuminate/Console/Scheduling/Event.php` ([70a72fc](https://github.com/laravel/framework/commit/70a72fcac9d8852fc1a4ce11eb47842774c11876))
-- Add `ensureOutputIsBeingCaptured` method to `Illuminate/Console/Scheduling/Event.php`
-- Add options for SES Mailer ([#25536](https://github.com/laravel/framework/pull/25536))
-- Add Ability to disable register route ([#25556](https://github.com/laravel/framework/pull/25556))
-
-### Fixed
-- Fix database cache on PostgreSQL ([#25530](https://github.com/laravel/framework/pull/25530))
-- Fix bug with invokables in `Illuminate/Console/Scheduling/CallbackEvent.php` ([eaac77b](https://github.com/laravel/framework/commit/eaac77bfb878b49f2ceff4fb09198e437d38683d))
-- Stop sending email verification if user already verified ([#25540](https://github.com/laravel/framework/pull/25540))
-- Fix `withoutMockingConsoleOutput` in `Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php` ([#25499](https://github.com/laravel/framework/pull/25499))
-- Fix DurationLimiter not using Redis connection proxy to call eval command ([#25505](https://github.com/laravel/framework/pull/25505))
-
-### Deprecated
-- Make `ensureOutputIsBeingCapturedForEmail` method deprecated in `Illuminate/Console/Scheduling/Event.php`
-
-
-## [v5.7.2 (2018-09-06)](https://github.com/laravel/framework/compare/v5.7.1...v5.7.2)
-
-### Added
-- Added `moontoast/math` suggestion to `Support` module ([79edf5c](https://github.com/laravel/framework/commit/79edf5c70c9a54c75e17da62ba3649f24b874e09))
-- Send an event when the user's email is verified ([045cbfd](https://github.com/laravel/framework/commit/045cbfd95c611928aef1b877d1a3dc60d5f19580))
-- Allow email verification middleware to work with API routes ([0e23b6a](https://github.com/laravel/framework/commit/0e23b6afa4d1d8b440ce7696a23fa770b4f7e5e3))
-- Add Builder::whereJsonLength() ([5e33a96](https://github.com/laravel/framework/commit/5e33a96cd5fe9f5bea953a3e07ec827d5f19a9a3), [f149fbd](https://github.com/laravel/framework/commit/f149fbd0fede21fc3a8c0347d1ab9ee858727bb4))
-- Pass configuration key parameter to updatePackageArray in Preset ([#25457](https://github.com/laravel/framework/pull/25457))
-- Let the WorkCommand specify whether to stop when queue is empty ([2524c5e](https://github.com/laravel/framework/commit/2524c5ee89a0c5e6e4e65c13d5f9945075bb299c))
-
-### Changed
-- Make email verification scaffolding translatable ([#25473](https://github.com/laravel/framework/pull/25473))
-- Do not mock console output by default ([b433970](https://github.com/laravel/framework/commit/b4339702dbdc5f1f55f30f1e6576450f6277e3ae))
-- Allow daemon to stop when there is no more jobs in the queue ([157a150](https://github.com/laravel/framework/commit/157a15080b95b26b2ccb0677dceab4964e25f18d))
-
-### Fixed
-- Do not send email verification if user is already verified ([#25450](https://github.com/laravel/framework/pull/25450))
-- Fixed required carbon version ([394f79f](https://github.com/laravel/framework/commit/394f79f9a6651b103f6e065cb4470b4b347239ea))
-
-
-## [v5.7.1 (2018-09-04)](https://github.com/laravel/framework/compare/v5.7.0...v5.7.1)
-
-### Fixed
-- Fixed an issue with basic auth when no field is defined
-
-### Changed
-- Remove X-UA-Compatible meta tag ([#25442](https://github.com/laravel/framework/pull/25442))
-- Added default array value for redis config ([#25443](https://github.com/laravel/framework/pull/25443))
-
-## [v5.7.0 (2018-09-04)](https://github.com/laravel/framework/compare/5.6...v5.7.0)
-
-Check the upgrade guide in the [Official Laravel Documentation](https://laravel.com/docs/5.7/upgrade). | false |
Other | laravel | framework | 0ecc2589023f8d0b51353c2cdd04f683342e1a61.json | Add WEBP to image validation rule | src/Illuminate/Validation/Concerns/ValidatesAttributes.php | @@ -988,7 +988,7 @@ public function validateLte($attribute, $value, $parameters)
*/
public function validateImage($attribute, $value)
{
- return $this->validateMimes($attribute, $value, ['jpeg', 'png', 'gif', 'bmp', 'svg']);
+ return $this->validateMimes($attribute, $value, ['jpeg', 'png', 'gif', 'bmp', 'svg', 'webp']);
}
/** | true |
Other | laravel | framework | 0ecc2589023f8d0b51353c2cdd04f683342e1a61.json | Add WEBP to image validation rule | tests/Validation/ValidationValidatorTest.php | @@ -2436,6 +2436,12 @@ public function testValidateImage()
$file6->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('svg'));
$v = new Validator($trans, ['x' => $file6], ['x' => 'Image']);
$this->assertTrue($v->passes());
+
+ $file7 = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock();
+ $file7->expects($this->any())->method('guessExtension')->will($this->returnValue('webp'));
+ $file7->expects($this->any())->method('getClientOriginalExtension')->will($this->returnValue('webp'));
+ $v = new Validator($trans, ['x' => $file7], ['x' => 'Image']);
+ $this->assertTrue($v->passes());
}
public function testValidateImageDoesNotAllowPhpExtensionsOnImageMime() | true |
Other | laravel | framework | 5b99ece878d0a7e3ed711a246588eeb9570c338f.json | Fix DELETE queries with joins on PostgreSQL | src/Illuminate/Database/Query/Grammars/PostgresGrammar.php | @@ -400,9 +400,9 @@ protected function compileDeleteWithJoins($query, $table)
return $this->wrapTable($join->table);
})->implode(', ');
- $where = count($query->wheres) > 0 ? ' '.$this->compileUpdateWheres($query) : '';
+ $where = $this->compileUpdateWheres($query);
- return trim("delete from {$table}{$using}{$where}");
+ return trim("delete from {$table}{$using} {$where}");
}
/** | true |
Other | laravel | framework | 5b99ece878d0a7e3ed711a246588eeb9570c338f.json | Fix DELETE queries with joins on PostgreSQL | tests/Database/DatabaseQueryBuilderTest.php | @@ -2183,6 +2183,11 @@ public function testDeleteWithJoinMethod()
})->where('name', 'baz')
->delete();
$this->assertEquals(1, $result);
+
+ $builder = $this->getPostgresBuilder();
+ $builder->getConnection()->shouldReceive('delete')->once()->with('delete from "users" USING "contacts" where "users"."id" = "contacts"."id"', [])->andReturn(1);
+ $result = $builder->from('users')->join('contacts', 'users.id', '=', 'contacts.id')->delete();
+ $this->assertEquals(1, $result);
}
public function testTruncateMethod() | true |
Other | laravel | framework | cc569504434599ad656ae81ca4fc745f4e7b6ab6.json | Fix deprecation comments | src/Illuminate/Database/Eloquent/Relations/BelongsTo.php | @@ -373,7 +373,7 @@ public function getRelationName()
* Get the name of the relationship.
*
* @return string
- * @deprecated The getRelationName() method should be used instead. Will be removed in Laravel 5.9.
+ * @deprecated The getRelationName() method should be used instead. Will be removed in Laravel 6.0.
*/
public function getRelation()
{ | true |
Other | laravel | framework | cc569504434599ad656ae81ca4fc745f4e7b6ab6.json | Fix deprecation comments | src/Illuminate/Support/ServiceProvider.php | @@ -17,7 +17,7 @@ abstract class ServiceProvider
/**
* Indicates if loading of the provider is deferred.
*
- * @deprecated Implement the \Illuminate\Contracts\Support\DeferrableProvider interface instead. Will be removed in Laravel 5.9.
+ * @deprecated Implement the \Illuminate\Contracts\Support\DeferrableProvider interface instead. Will be removed in Laravel 6.0.
*
* @var bool
*/ | true |
Other | laravel | framework | e5bc19c54761ff53a8f297088a7b7d482e5b0a6b.json | Fix typo in test methods names | tests/Database/DatabaseEloquentBelongsToManyWithDefaultAttributesTest.php | @@ -15,13 +15,13 @@ protected function tearDown(): void
m::close();
}
- public function testwithPivotValueMethodSetsWhereConditionsForFetching()
+ public function testWithPivotValueMethodSetsWhereConditionsForFetching()
{
$relation = $this->getMockBuilder(BelongsToMany::class)->setMethods(['touchIfTouching'])->setConstructorArgs($this->getRelationArguments())->getMock();
$relation->withPivotValue(['is_admin' => 1]);
}
- public function testwithPivotValueMethodSetsDefaultArgumentsForInsertion()
+ public function testWithPivotValueMethodSetsDefaultArgumentsForInsertion()
{
$relation = $this->getMockBuilder(BelongsToMany::class)->setMethods(['touchIfTouching'])->setConstructorArgs($this->getRelationArguments())->getMock();
$relation->withPivotValue(['is_admin' => 1]); | false |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | bin/release.sh | @@ -9,7 +9,7 @@ then
exit 1
fi
-CURRENT_BRANCH="5.9"
+CURRENT_BRANCH="6.0"
VERSION=$1
# Always prepend with "v" | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | composer.json | @@ -110,7 +110,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Auth/composer.json | @@ -15,10 +15,10 @@
],
"require": {
"php": "^7.2",
- "illuminate/contracts": "5.9.*",
- "illuminate/http": "5.9.*",
- "illuminate/queue": "5.9.*",
- "illuminate/support": "5.9.*"
+ "illuminate/contracts": "^6.0",
+ "illuminate/http": "^6.0",
+ "illuminate/queue": "^6.0",
+ "illuminate/support": "^6.0"
},
"autoload": {
"psr-4": {
@@ -27,13 +27,13 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": {
- "illuminate/console": "Required to use the auth:clear-resets command (5.9.*).",
- "illuminate/queue": "Required to fire login / logout events (5.9.*).",
- "illuminate/session": "Required to use the session based guard (5.9.*)."
+ "illuminate/console": "Required to use the auth:clear-resets command (^6.0).",
+ "illuminate/queue": "Required to fire login / logout events (^6.0).",
+ "illuminate/session": "Required to use the session based guard (^6.0)."
},
"config": {
"sort-packages": true | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Broadcasting/composer.json | @@ -17,10 +17,10 @@
"php": "^7.2",
"ext-json": "*",
"psr/log": "^1.0",
- "illuminate/bus": "5.9.*",
- "illuminate/contracts": "5.9.*",
- "illuminate/queue": "5.9.*",
- "illuminate/support": "5.9.*"
+ "illuminate/bus": "^6.0",
+ "illuminate/contracts": "^6.0",
+ "illuminate/queue": "^6.0",
+ "illuminate/support": "^6.0"
},
"autoload": {
"psr-4": {
@@ -29,7 +29,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Bus/composer.json | @@ -15,9 +15,9 @@
],
"require": {
"php": "^7.2",
- "illuminate/contracts": "5.9.*",
- "illuminate/pipeline": "5.9.*",
- "illuminate/support": "5.9.*"
+ "illuminate/contracts": "^6.0",
+ "illuminate/pipeline": "^6.0",
+ "illuminate/support": "^6.0"
},
"autoload": {
"psr-4": {
@@ -26,7 +26,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Cache/composer.json | @@ -15,8 +15,8 @@
],
"require": {
"php": "^7.2",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*"
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0*"
},
"autoload": {
"psr-4": {
@@ -25,13 +25,13 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": {
- "illuminate/database": "Required to use the database cache driver (5.9.*).",
- "illuminate/filesystem": "Required to use the file cache driver (5.9.*).",
- "illuminate/redis": "Required to use the redis cache driver (5.9.*)."
+ "illuminate/database": "Required to use the database cache driver (^6.0).",
+ "illuminate/filesystem": "Required to use the file cache driver (^6.0).",
+ "illuminate/redis": "Required to use the redis cache driver (^6.0)."
},
"config": {
"sort-packages": true | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Config/composer.json | @@ -15,8 +15,8 @@
],
"require": {
"php": "^7.2",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*"
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0"
},
"autoload": {
"psr-4": {
@@ -25,7 +25,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Console/composer.json | @@ -15,8 +15,8 @@
],
"require": {
"php": "^7.2",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*",
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0",
"symfony/console": "^4.3",
"symfony/process": "^4.3"
},
@@ -27,13 +27,13 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": {
"dragonmantank/cron-expression": "Required to use scheduling component (^2.0).",
"guzzlehttp/guzzle": "Required to use the ping methods on schedules (^6.0).",
- "illuminate/filesystem": "Required to use the generator command (5.9.*)"
+ "illuminate/filesystem": "Required to use the generator command (^6.0)"
},
"config": {
"sort-packages": true | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Container/composer.json | @@ -15,8 +15,8 @@
],
"require": {
"php": "^7.2",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*",
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0",
"psr/container": "^1.0"
},
"autoload": {
@@ -26,7 +26,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Contracts/composer.json | @@ -25,7 +25,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Cookie/composer.json | @@ -15,8 +15,8 @@
],
"require": {
"php": "^7.2",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*",
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0",
"symfony/http-foundation": "^4.3",
"symfony/http-kernel": "^4.3"
},
@@ -27,7 +27,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Database/composer.json | @@ -17,9 +17,9 @@
"require": {
"php": "^7.2",
"ext-json": "*",
- "illuminate/container": "5.9.*",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*"
+ "illuminate/container": "^6.0",
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0"
},
"autoload": {
"psr-4": {
@@ -28,16 +28,16 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": {
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).",
"fzaninotto/faker": "Required to use the eloquent factory builder (^1.4).",
- "illuminate/console": "Required to use the database commands (5.9.*).",
- "illuminate/events": "Required to use the observers with Eloquent (5.9.*).",
- "illuminate/filesystem": "Required to use the migrations (5.9.*).",
- "illuminate/pagination": "Required to paginate the result set (5.9.*)."
+ "illuminate/console": "Required to use the database commands (^6.0).",
+ "illuminate/events": "Required to use the observers with Eloquent (^6.0).",
+ "illuminate/filesystem": "Required to use the migrations (^6.0).",
+ "illuminate/pagination": "Required to paginate the result set (^6.0)."
},
"config": {
"sort-packages": true | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Encryption/composer.json | @@ -18,8 +18,8 @@
"ext-json": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*"
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0"
},
"autoload": {
"psr-4": {
@@ -28,7 +28,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Events/composer.json | @@ -15,9 +15,9 @@
],
"require": {
"php": "^7.2",
- "illuminate/container": "5.9.*",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*"
+ "illuminate/container": "^6.0",
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0"
},
"autoload": {
"psr-4": {
@@ -26,7 +26,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Filesystem/composer.json | @@ -15,8 +15,8 @@
],
"require": {
"php": "^7.2",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*",
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0",
"symfony/finder": "^4.3"
},
"autoload": {
@@ -26,7 +26,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Foundation/Application.php | @@ -30,7 +30,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn
*
* @var string
*/
- const VERSION = '5.9-dev';
+ const VERSION = '6.0-dev';
/**
* The base path for the Laravel installation. | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Hashing/composer.json | @@ -15,8 +15,8 @@
],
"require": {
"php": "^7.2",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*"
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0"
},
"autoload": {
"psr-4": {
@@ -25,7 +25,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Http/composer.json | @@ -16,8 +16,8 @@
"require": {
"php": "^7.2",
"ext-json": "*",
- "illuminate/session": "5.9.*",
- "illuminate/support": "5.9.*",
+ "illuminate/session": "^6.0",
+ "illuminate/support": "^6.0",
"symfony/http-foundation": "^4.3",
"symfony/http-kernel": "^4.3"
},
@@ -28,7 +28,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Log/composer.json | @@ -15,8 +15,8 @@
],
"require": {
"php": "^7.2",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*",
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0",
"monolog/monolog": "^1.11"
},
"autoload": {
@@ -26,7 +26,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Mail/composer.json | @@ -17,9 +17,9 @@
"php": "^7.2",
"ext-json": "*",
"erusev/parsedown": "^1.7",
- "illuminate/container": "5.9.*",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*",
+ "illuminate/container": "^6.0",
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0",
"psr/log": "^1.0",
"swiftmailer/swiftmailer": "^6.0",
"tijsverkoyen/css-to-inline-styles": "^2.2.1"
@@ -31,7 +31,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Notifications/composer.json | @@ -15,14 +15,14 @@
],
"require": {
"php": "^7.2",
- "illuminate/broadcasting": "5.9.*",
- "illuminate/bus": "5.9.*",
- "illuminate/container": "5.9.*",
- "illuminate/contracts": "5.9.*",
- "illuminate/filesystem": "5.9.*",
- "illuminate/mail": "5.9.*",
- "illuminate/queue": "5.9.*",
- "illuminate/support": "5.9.*"
+ "illuminate/broadcasting": "^6.0",
+ "illuminate/bus": "^6.0",
+ "illuminate/container": "^6.0",
+ "illuminate/contracts": "^6.0",
+ "illuminate/filesystem": "^6.0",
+ "illuminate/mail": "^6.0",
+ "illuminate/queue": "^6.0",
+ "illuminate/support": "^6.0"
},
"autoload": {
"psr-4": {
@@ -31,11 +31,11 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": {
- "illuminate/database": "Required to use the database transport (5.9.*)."
+ "illuminate/database": "Required to use the database transport (^6.0)."
},
"config": {
"sort-packages": true | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Pagination/composer.json | @@ -16,8 +16,8 @@
"require": {
"php": "^7.2",
"ext-json": "*",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*"
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0"
},
"autoload": {
"psr-4": {
@@ -26,7 +26,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Pipeline/composer.json | @@ -15,8 +15,8 @@
],
"require": {
"php": "^7.2",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*"
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0"
},
"autoload": {
"psr-4": {
@@ -25,7 +25,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Queue/composer.json | @@ -16,12 +16,12 @@
"require": {
"php": "^7.2",
"ext-json": "*",
- "illuminate/console": "5.9.*",
- "illuminate/container": "5.9.*",
- "illuminate/contracts": "5.9.*",
- "illuminate/database": "5.9.*",
- "illuminate/filesystem": "5.9.*",
- "illuminate/support": "5.9.*",
+ "illuminate/console": "^6.0*",
+ "illuminate/container": "^6.0",
+ "illuminate/contracts": "^6.0",
+ "illuminate/database": "^6.0",
+ "illuminate/filesystem": "^6.0",
+ "illuminate/support": "^6.0",
"opis/closure": "^3.1",
"symfony/debug": "^4.3",
"symfony/process": "^4.3"
@@ -33,14 +33,14 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": {
"ext-pcntl": "Required to use all features of the queue worker.",
"ext-posix": "Required to use all features of the queue worker.",
"aws/aws-sdk-php": "Required to use the SQS queue driver (^3.0).",
- "illuminate/redis": "Required to use the Redis queue driver (5.9.*).",
+ "illuminate/redis": "Required to use the Redis queue driver (^6.0).",
"pda/pheanstalk": "Required to use the Beanstalk queue driver (^4.0)."
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Redis/composer.json | @@ -15,8 +15,8 @@
],
"require": {
"php": "^7.2",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*",
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0",
"predis/predis": "^1.0"
},
"autoload": {
@@ -26,7 +26,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Routing/composer.json | @@ -16,12 +16,12 @@
"require": {
"php": "^7.2",
"ext-json": "*",
- "illuminate/container": "5.9.*",
- "illuminate/contracts": "5.9.*",
- "illuminate/http": "5.9.*",
- "illuminate/pipeline": "5.9.*",
- "illuminate/session": "5.9.*",
- "illuminate/support": "5.9.*",
+ "illuminate/container": "^6.0",
+ "illuminate/contracts": "^6.0",
+ "illuminate/http": "^6.0",
+ "illuminate/pipeline": "^6.0",
+ "illuminate/session": "^6.0",
+ "illuminate/support": "^6.0",
"symfony/debug": "^4.3",
"symfony/http-foundation": "^4.3",
"symfony/http-kernel": "^4.3",
@@ -34,11 +34,11 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": {
- "illuminate/console": "Required to use the make commands (5.9.*).",
+ "illuminate/console": "Required to use the make commands (^6.0).",
"symfony/psr-http-message-bridge": "Required to psr7 bridging features (^1.1)."
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Session/composer.json | @@ -16,9 +16,9 @@
"require": {
"php": "^7.2",
"ext-json": "*",
- "illuminate/contracts": "5.9.*",
- "illuminate/filesystem": "5.9.*",
- "illuminate/support": "5.9.*",
+ "illuminate/contracts": "^6.0",
+ "illuminate/filesystem": "^6.0",
+ "illuminate/support": "^6.0",
"symfony/finder": "^4.3",
"symfony/http-foundation": "^4.3"
},
@@ -29,11 +29,11 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": {
- "illuminate/console": "Required to use the session:table command (5.9.*)."
+ "illuminate/console": "Required to use the session:table command (^6.0)."
},
"config": {
"sort-packages": true | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Support/composer.json | @@ -18,7 +18,7 @@
"ext-json": "*",
"ext-mbstring": "*",
"doctrine/inflector": "^1.1",
- "illuminate/contracts": "5.9.*",
+ "illuminate/contracts": "^6.0",
"nesbot/carbon": "^2.0"
},
"conflict": {
@@ -34,11 +34,11 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": {
- "illuminate/filesystem": "Required to use the composer class (5.9.*).",
+ "illuminate/filesystem": "Required to use the composer class (^6.0).",
"moontoast/math": "Required to use ordered UUIDs (^1.1).",
"ramsey/uuid": "Required to use Str::uuid() (^3.7).",
"symfony/process": "Required to use the composer class (^4.3).", | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Translation/composer.json | @@ -16,9 +16,9 @@
"require": {
"php": "^7.2",
"ext-json": "*",
- "illuminate/contracts": "5.9.*",
- "illuminate/filesystem": "5.9.*",
- "illuminate/support": "5.9.*"
+ "illuminate/contracts": "^6.0",
+ "illuminate/filesystem": "^6.0",
+ "illuminate/support": "^6.0"
},
"autoload": {
"psr-4": {
@@ -27,7 +27,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/Validation/composer.json | @@ -17,10 +17,10 @@
"php": "^7.2",
"ext-json": "*",
"egulias/email-validator": "^2.0",
- "illuminate/container": "5.9.*",
- "illuminate/contracts": "5.9.*",
- "illuminate/support": "5.9.*",
- "illuminate/translation": "5.9.*",
+ "illuminate/container": "^6.0",
+ "illuminate/contracts": "^6.0",
+ "illuminate/support": "^6.0",
+ "illuminate/translation": "^6.0",
"symfony/http-foundation": "^4.3"
},
"autoload": {
@@ -30,11 +30,11 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"suggest": {
- "illuminate/database": "Required to use the database presence verifier (5.9.*)."
+ "illuminate/database": "Required to use the database presence verifier (^6.0)."
},
"config": {
"sort-packages": true | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | src/Illuminate/View/composer.json | @@ -16,11 +16,11 @@
"require": {
"php": "^7.2",
"ext-json": "*",
- "illuminate/container": "5.9.*",
- "illuminate/contracts": "5.9.*",
- "illuminate/events": "5.9.*",
- "illuminate/filesystem": "5.9.*",
- "illuminate/support": "5.9.*",
+ "illuminate/container": "^6.0",
+ "illuminate/contracts": "^6.0",
+ "illuminate/events": "^6.0",
+ "illuminate/filesystem": "^6.0",
+ "illuminate/support": "^6.0",
"symfony/debug": "^4.3"
},
"autoload": {
@@ -30,7 +30,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "5.9-dev"
+ "dev-master": "6.0-dev"
}
},
"config": { | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | tests/Console/ConsoleApplicationTest.php | @@ -53,7 +53,7 @@ public function testResolveAddsCommandViaApplicationResolution()
public function testCallFullyStringCommandLine()
{
$app = new Application(
- $app = m::mock(ApplicationContract::class, ['version' => '5.9']),
+ $app = m::mock(ApplicationContract::class, ['version' => '6.0']),
$events = m::mock(Dispatcher::class, ['dispatch' => null, 'fire' => null]),
'testing'
);
@@ -79,7 +79,7 @@ public function testCallFullyStringCommandLine()
protected function getMockConsole(array $methods)
{
- $app = m::mock(ApplicationContract::class, ['version' => '5.9']);
+ $app = m::mock(ApplicationContract::class, ['version' => '6.0']);
$events = m::mock(Dispatcher::class, ['dispatch' => null]);
return $this->getMockBuilder(Application::class)->setMethods($methods)->setConstructorArgs([ | true |
Other | laravel | framework | f588c458574be4c7a7fa2714baab18c599d8dc66.json | Update version constraints for 6.0 | tests/Support/SupportTestingMailFakeTest.php | @@ -146,7 +146,7 @@ class MailableStub extends Mailable implements MailableContract
{
public $framework = 'Laravel';
- protected $version = '5.9';
+ protected $version = '6.0';
/**
* Build the message.
@@ -164,7 +164,7 @@ class QueueableMailableStub extends Mailable implements ShouldQueue
{
public $framework = 'Laravel';
- protected $version = '5.9';
+ protected $version = '6.0';
/**
* Build the message. | true |
Other | laravel | framework | 647cca5a44ad2bd56be1969a096dbd94b18dc3c6.json | Test the extend system | tests/Redis/RedisManagerExtensionTest.php | @@ -0,0 +1,88 @@
+<?php
+
+namespace Illuminate\Tests\Redis;
+
+use Illuminate\Contracts\Redis\Connector;
+use Illuminate\Foundation\Application;
+use Illuminate\Redis\RedisManager;
+use PHPUnit\Framework\TestCase;
+
+class RedisManagerExtensionTest extends TestCase
+{
+ /**
+ * Redis manager instance.
+ *
+ * @var RedisManager
+ */
+ protected $redis;
+
+ protected function setUp(): void
+ {
+ parent::setUp();
+
+ $this->redis = new RedisManager(new Application(), 'my_custom_driver', [
+ 'default' => [
+ 'host' => 'some-host',
+ 'port' => 'some-port',
+ 'database' => 5,
+ 'timeout' => 0.5,
+ ],
+ 'clusters' => [
+ 'my-cluster' => [
+ [
+ 'host' => 'some-host',
+ 'port' => 'some-port',
+ 'database' => 5,
+ 'timeout' => 0.5,
+ ]
+ ]
+ ]
+ ]);
+
+ $this->redis->extend('my_custom_driver', function () {
+ return new FakeRedisConnnector();
+ });
+ }
+
+ public function test_using_custom_redis_connector_with_single_redis_instance()
+ {
+ $this->assertEquals(
+ 'my-redis-connection', $this->redis->resolve()
+ );
+ }
+
+ public function test_using_custom_redis_connector_with_redis_cluster_instance()
+ {
+ $this->assertEquals(
+ 'my-redis-cluster-connection', $this->redis->resolve('my-cluster')
+ );
+ }
+}
+
+class FakeRedisConnnector implements Connector
+{
+ /**
+ * Create a new clustered Predis connection.
+ *
+ * @param array $config
+ * @param array $options
+ * @return \Illuminate\Contracts\Redis\Connection
+ */
+ public function connect(array $config, array $options)
+ {
+ return 'my-redis-connection';
+ }
+
+ /**
+ * Create a new clustered Predis connection.
+ *
+ * @param array $config
+ * @param array $clusterOptions
+ * @param array $options
+ * @return \Illuminate\Contracts\Redis\Connection
+ */
+ public function connectToCluster(array $config, array $clusterOptions, array $options)
+ {
+ return 'my-redis-cluster-connection';
+ }
+} | false |
Other | laravel | framework | 847b196c7bf3cadae09ce9ebb6d4a2a4664518d2.json | Add support for custom drivers
This portion of code is heavily inspired by the CacheManager extension system. | src/Illuminate/Contracts/Redis/Connector.php | @@ -0,0 +1,25 @@
+<?php
+
+namespace Illuminate\Contracts\Redis;
+
+interface Connector
+{
+ /**
+ * Create a new clustered Predis connection.
+ *
+ * @param array $config
+ * @param array $options
+ * @return \Illuminate\Contracts\Redis\Connection
+ */
+ public function connect(array $config, array $options);
+
+ /**
+ * Create a new clustered Predis connection.
+ *
+ * @param array $config
+ * @param array $clusterOptions
+ * @param array $options
+ * @return \Illuminate\Contracts\Redis\Connection
+ */
+ public function connectToCluster(array $config, array $clusterOptions, array $options);
+} | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.