File: tests/unit/SSCTest.php

Recommend this page to a friend!
  Classes of Marcos Sigueros  >  Stupidly Simple PHP Calendar  >  tests/unit/SSCTest.php  >  Download  
File: tests/unit/SSCTest.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: Stupidly Simple PHP Calendar
Render calendars as arrays of time elements
Author: By
Last change: Changes to adapt the library, first step to refactoring
Date: 3 years ago
Size: 611 bytes
 

Contents

Class file image Download
<?php

class SSCTest extends \PHPUnit\Framework\TestCase{
   
   
/**
     * Default test. A 6 months calendar with the entire structure, including:
     * Quarters, weeks...
     */
   
public function testDefault()
    {
       
$cal = new \SSC\Calendar();
       
$structure = $cal->getCalendarStructure();
       
       
$this->assertArrayHasKey(date('Y'), $structure);
       
$quarter = (int) ceil(date('n') / 3);
       
$this->assertArrayHasKey($quarter, $structure[date('Y')]['elements']);
       
$this->assertArrayHasKey(date('n'), $structure[date('Y')]['elements'][$quarter]['elements']);
    }
}


For more information send a message to info at phpclasses dot org.