From cfc17676b10d2b82072963cded668b1ad22a96e2 Mon Sep 17 00:00:00 2001 From: Michele Orselli Date: Sat, 28 Oct 2017 19:58:01 +0200 Subject: [PATCH 1/2] adds unit test for checking year on licence --- LICENSE.txt | 2 +- test/unit/LicenceYearTest.php | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 test/unit/LicenceYearTest.php diff --git a/LICENSE.txt b/LICENSE.txt index c1631d6..53c76d3 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 SendGrid, Inc. +Copyright (c) 2012-2017 SendGrid, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/unit/LicenceYearTest.php b/test/unit/LicenceYearTest.php new file mode 100644 index 0000000..1b06379 --- /dev/null +++ b/test/unit/LicenceYearTest.php @@ -0,0 +1,19 @@ +assertEquals($expected, $copyright); + } + +} From 568b9055a506e30ab66a7f5b0a87d08f4bd0d40a Mon Sep 17 00:00:00 2001 From: Michele Orselli Date: Sun, 17 Dec 2017 12:24:47 +0100 Subject: [PATCH 2/2] fixes file path --- test/unit/LicenceYearTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/unit/LicenceYearTest.php b/test/unit/LicenceYearTest.php index 1b06379..515a26c 100644 --- a/test/unit/LicenceYearTest.php +++ b/test/unit/LicenceYearTest.php @@ -6,7 +6,9 @@ class LicenceYearTest extends \PHPUnit_Framework_TestCase { public function testConstructor() { - $license = explode("\n", file_get_contents('./LICENSE.txt')); + $rootDir = __DIR__ . '/../..'; + + $license = explode("\n", file_get_contents("$rootDir/LICENSE.txt")); $copyright = $license[2]; $year = date('Y');