query.test.php 783 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. class QueryTest extends PHPUnit_Framework_TestCase {
  3. /**
  4. * Test the "find" method.
  5. *
  6. * @group laravel
  7. */
  8. public function testFindMethodCanReturnByID()
  9. {
  10. $this->assertEquals('taylor@example.com', $this->query()->find(1)->email);
  11. }
  12. /**
  13. * Test the select method.
  14. *
  15. * @group laravel
  16. */
  17. public function testSelectMethodLimitsColumns()
  18. {
  19. $result = $this->query()->select(array('email'))->first();
  20. $this->assertTrue(isset($result->email));
  21. $this->assertFalse(isset($result->name));
  22. }
  23. /**
  24. * Test the raw_where method.
  25. *
  26. * @group laravel
  27. */
  28. public function testRawWhereCanBeUsed()
  29. {
  30. }
  31. /**
  32. * Get the query instance for the test case.
  33. *
  34. * @return Query
  35. */
  36. protected function query()
  37. {
  38. return DB::table('query_test');
  39. }
  40. }