PHP Classes

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: Update of tests/unit/SSCTest.php
Date: 8 months 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']);
    }
}