/**
  * Regression test for issue #27
  * @see https://github.com/Vinelab/NeoEloquent/issues/27
  */
 public function testDoesntCrashOnNonIntIds()
 {
     $u = User::create([]);
     $id = (string) $u->id;
     $found = User::where('id', "{$id}")->first();
     $this->assertEquals($found, $u);
     $foundAgain = User::where('id(individual)', "{$id}")->first();
     $this->assertEquals($foundAgain, $u);
 }
Пример #2
0
 public function setUp()
 {
     parent::setUp();
     $resolver = M::mock('Illuminate\\Database\\ConnectionResolverInterface');
     $resolver->shouldReceive('connection')->andReturn($this->getConnectionWithConfig('default'));
     User::setConnectionResolver($resolver);
     // Setup the data in the database
     $this->ab = User::create(['name' => 'Ey Bee', 'alias' => 'ab', 'email' => '*****@*****.**', 'calls' => 10]);
     $this->cd = User::create(['name' => 'See Dee', 'alias' => 'cd', 'email' => '*****@*****.**', 'calls' => 20]);
     $this->ef = User::create(['name' => 'Eee Eff', 'alias' => 'ef', 'email' => '*****@*****.**', 'calls' => 30]);
     $this->gh = User::create(['name' => 'Gee Aych', 'alias' => 'gh', 'email' => '*****@*****.**', 'calls' => 40]);
     $this->ij = User::create(['name' => 'Eye Jay', 'alias' => 'ij', 'email' => '*****@*****.**', 'calls' => 50]);
 }