TestsCarbonIntervalGettersTest

The Simple Calendar Tests CarbonInterval GettersTest class.

Defined (1)

The class is defined in the following location(s).

/vendor/nesbot/carbon/tests/CarbonInterval/GettersTest.php  
  1. class GettersTest extends AbstractTestCase 
  2. public function testGettersThrowExceptionOnUnknownGetter() 
  3. $this->setExpectedException('InvalidArgumentException'); 
  4. CarbonInterval::year()->sdfsdfss; 
  5.  
  6. public function testYearsGetter() 
  7. $d = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); 
  8. $this->assertSame(4, $d->years); 
  9.  
  10. public function testMonthsGetter() 
  11. $d = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); 
  12. $this->assertSame(5, $d->months); 
  13.  
  14. public function testWeeksGetter() 
  15. $d = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); 
  16. $this->assertSame(6, $d->weeks); 
  17.  
  18. public function testDayzExcludingWeeksGetter() 
  19. $d = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); 
  20. $this->assertSame(5, $d->daysExcludeWeeks); 
  21. $this->assertSame(5, $d->dayzExcludeWeeks); 
  22.  
  23. public function testDayzGetter() 
  24. $d = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); 
  25. $this->assertSame(6 * 7 + 5, $d->dayz); 
  26.  
  27. public function testHoursGetter() 
  28. $d = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); 
  29. $this->assertSame(8, $d->hours); 
  30.  
  31. public function testMinutesGetter() 
  32. $d = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); 
  33. $this->assertSame(9, $d->minutes); 
  34.  
  35. public function testSecondsGetter() 
  36. $d = CarbonInterval::create(4, 5, 6, 5, 8, 9, 10); 
  37. $this->assertSame(10, $d->seconds);