Skip to content

Commit 2ed92f3

Browse files
committed
add unit test for license year
1 parent c166393 commit 2ed92f3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/unit/LicenseYearTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace SendGrid\Test;
4+
5+
class LicenseYearTest extends \PHPUnit_Framework_TestCase
6+
{
7+
8+
public function testLicenseYear()
9+
{
10+
$license = explode("\n", file_get_contents('../../LICENSE.txt'));
11+
$copyright = '';
12+
foreach ($license as $line) {
13+
if (strpos($line, 'Copyright') === 0) {
14+
$copyright = $line;
15+
break;
16+
}
17+
}
18+
$year = date('Y');
19+
$expected = "Copyright (c) 2016-{$year} SendGrid, Inc.";
20+
$this->assertEquals($expected, $copyright);
21+
}
22+
}

0 commit comments

Comments
 (0)