for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace MaksimM\CompositePrimaryKeys\Tests;
use MaksimM\CompositePrimaryKeys\Tests\Stubs\TestUser;
class OtherQueriesTest extends CompositeKeyBaseUnit
{
/** @test */
public function validateKeyExclusion()
/**
* @var TestUser
*/
$model = TestUser::whereKeyNot([
'user_id' => 1,
'organization_id' => 100,
])
->where('user_id',1)
->first();
$this->assertNotNull($model);
$this->assertInstanceOf(TestUser::class, $model);
return $model;
}
/** @test
* @depends validateSingleModelLookup
public function validateSingleModelLookupModel(TestUser $model)
$this->assertEquals(1, $model->user_id);
$this->assertEquals(101, $model->organization_id);
$this->assertEquals('Bar', $model->name);
* @test
public function validateDeleteModel()
TestUser::find([
])->delete();
$this->assertNull(TestUser::find([
]));
public function validateDeleteWithoutFetching()
TestUser::whereKey([