Skip to content

Commit 3fe5cd7

Browse files
Merge pull request sendgrid#61 from micheleorselli/unittest_for_year_in_licence
Adds unit test for checking year on licence
2 parents 5556761 + bf115e7 commit 3fe5cd7

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016-2017 SendGrid, Inc.
3+
Copyright (c) 2012-2017 SendGrid, Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

test/unit/LicenceYearTest.php

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace SendGrid\Test;
4+
5+
class LicenceYearTest extends \PHPUnit_Framework_TestCase
6+
{
7+
public function testConstructor()
8+
{
9+
$rootDir = __DIR__ . '/../..';
10+
11+
$license = explode("\n", file_get_contents("$rootDir/LICENSE.txt"));
12+
$copyright = $license[2];
13+
14+
$year = date('Y');
15+
16+
$expected = "Copyright (c) 2012-{$year} SendGrid, Inc.";
17+
18+
$this->assertEquals($expected, $copyright);
19+
}
20+
21+
}

0 commit comments

Comments
 (0)