-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #304 from spurwork/ss-1131-2024-federal-taxes
SS-1131 - 2024 social security tax
- Loading branch information
Showing
4 changed files
with
212 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/Countries/US/SocialSecurity/V20240101/SocialSecurity.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Countries\US\SocialSecurity\V20240101; | ||
|
||
use Appleton\Taxes\Countries\US\SocialSecurity\SocialSecurity as BaseSocialSecurity; | ||
|
||
class SocialSecurity extends BaseSocialSecurity | ||
{ | ||
public const TAX_RATE = 0.062; | ||
public const WAGE_BASE = 168600; | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Countries/US/SocialSecurity/V20240101/SocialSecurityEmployer.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Countries\US\SocialSecurity\V20240101; | ||
|
||
use Appleton\Taxes\Countries\US\SocialSecurity\SocialSecurityEmployer as BaseSocialSecurityEmployer; | ||
|
||
class SocialSecurityEmployer extends BaseSocialSecurityEmployer | ||
{ | ||
public const TAX_RATE = SocialSecurity::TAX_RATE; | ||
public const WAGE_BASE = SocialSecurity::WAGE_BASE; | ||
} |
95 changes: 95 additions & 0 deletions
95
tests/Unit/Countries/US/SocialSecurity/V20240101/SocialSecurityEmployerTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Tests\Unit\Countries\US\SocialSecurity\V20240101; | ||
|
||
use Appleton\Taxes\Countries\US\SocialSecurity\SocialSecurityEmployer; | ||
use Appleton\Taxes\Tests\Unit\Countries\TestParameters; | ||
use Appleton\Taxes\Tests\Unit\Countries\TestParametersBuilder; | ||
use Appleton\Taxes\Tests\Unit\Countries\WageBaseTaxTestCase; | ||
|
||
class SocialSecurityEmployerTest extends WageBaseTaxTestCase | ||
{ | ||
private const DATE = '2024-01-01'; | ||
private const LOCATION = 'us'; | ||
private const TAX_CLASS = SocialSecurityEmployer::class; | ||
private const TAX_RATE = 0.062; | ||
private const WAGE_BASE = 16860000; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->query_runner->addTax(self::TAX_CLASS); | ||
} | ||
|
||
/** | ||
* @dataProvider provideData | ||
*/ | ||
public function testCases(TestParameters $parameters): void | ||
{ | ||
$this->validate($parameters); | ||
} | ||
|
||
/** | ||
* @dataProvider provideWageBaseData | ||
*/ | ||
public function testWageBase(TestParameters $parameters): void | ||
{ | ||
$this->validateWageBase($parameters); | ||
} | ||
|
||
public function provideData(): array | ||
{ | ||
$builder = new TestParametersBuilder(); | ||
$builder | ||
->setDate(self::DATE) | ||
->setHomeLocation(self::LOCATION) | ||
->setTaxClass(self::TAX_CLASS) | ||
->setPayPeriods(52); | ||
|
||
return [ | ||
'case study A' => [ | ||
$builder | ||
->setWagesInCents(64000) | ||
->setYtdWagesInCents(0) | ||
->setExpectedAmountInCents(3968) | ||
->setExpectedEarningsInCents(64000) | ||
->build() | ||
], | ||
'case study B' => [ | ||
$builder | ||
->setWagesInCents(77428) | ||
->setYtdWagesInCents(0) | ||
->setExpectedAmountInCents(4801) | ||
->setExpectedEarningsInCents(77428) | ||
->build() | ||
], | ||
'case study C' => [ | ||
$builder | ||
->setWagesInCents(64000) | ||
->setYtdWagesInCents(13300000) | ||
->setExpectedAmountInCents(3968) | ||
->setExpectedEarningsInCents(64000) | ||
->build() | ||
], | ||
'case study D' => [ | ||
$builder | ||
->setWagesInCents(77428) | ||
->setYtdWagesInCents(13300000) | ||
->setExpectedAmountInCents(4801) | ||
->setExpectedEarningsInCents(77428) | ||
->build() | ||
], | ||
]; | ||
} | ||
|
||
public function provideWageBaseData(): array | ||
{ | ||
return $this->wageBaseBoundariesTestCases( | ||
self::DATE, | ||
self::LOCATION, | ||
self::TAX_CLASS, | ||
self::WAGE_BASE, | ||
self::TAX_RATE | ||
); | ||
} | ||
} |
95 changes: 95 additions & 0 deletions
95
tests/Unit/Countries/US/SocialSecurity/V20240101/SocialSecurityTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
|
||
namespace Appleton\Taxes\Tests\Unit\Countries\US\SocialSecurity\V20240101; | ||
|
||
use Appleton\Taxes\Countries\US\SocialSecurity\SocialSecurity; | ||
use Appleton\Taxes\Tests\Unit\Countries\TestParameters; | ||
use Appleton\Taxes\Tests\Unit\Countries\TestParametersBuilder; | ||
use Appleton\Taxes\Tests\Unit\Countries\WageBaseTaxTestCase; | ||
|
||
class SocialSecurityTest extends WageBaseTaxTestCase | ||
{ | ||
private const DATE = '2024-01-01'; | ||
private const LOCATION = 'us'; | ||
private const TAX_CLASS = SocialSecurity::class; | ||
private const WAGE_BASE_IN_CENTS = 16860000; | ||
private const TAX_RATE = 0.062; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->query_runner->addTax(self::TAX_CLASS); | ||
} | ||
|
||
/** | ||
* @dataProvider provideTestData | ||
*/ | ||
public function testTax(TestParameters $parameters): void | ||
{ | ||
$this->validate($parameters); | ||
} | ||
|
||
/** | ||
* @dataProvider provideWageBaseTestData | ||
*/ | ||
public function testWageBase(TestParameters $parameters): void | ||
{ | ||
$this->validateWageBase($parameters); | ||
} | ||
|
||
public function provideTestData(): array | ||
{ | ||
$builder = new TestParametersBuilder(); | ||
$builder | ||
->setDate(self::DATE) | ||
->setHomeLocation(self::LOCATION) | ||
->setTaxClass(self::TAX_CLASS) | ||
->setPayPeriods(52); | ||
|
||
return [ | ||
'case study A' => [ | ||
$builder | ||
->setWagesInCents(64000) | ||
->setYtdLiabilitiesInCents(0) | ||
->setExpectedAmountInCents(3968) | ||
->setExpectedEarningsInCents(64000) | ||
->build() | ||
], | ||
'case study B' => [ | ||
$builder | ||
->setWagesInCents(77428) | ||
->setYtdLiabilitiesInCents(0) | ||
->setExpectedAmountInCents(4801) | ||
->setExpectedEarningsInCents(77428) | ||
->build() | ||
], | ||
'case study C' => [ | ||
$builder | ||
->setWagesInCents(64000) | ||
->setYtdLiabilitiesInCents(13300000) | ||
->setExpectedAmountInCents(3968) | ||
->setExpectedEarningsInCents(64000) | ||
->build() | ||
], | ||
'case study D' => [ | ||
$builder | ||
->setWagesInCents(77428) | ||
->setYtdLiabilitiesInCents(13300000) | ||
->setExpectedAmountInCents(4801) | ||
->setExpectedEarningsInCents(77428) | ||
->build() | ||
], | ||
]; | ||
} | ||
|
||
public function provideWageBaseTestData(): array | ||
{ | ||
return $this->wageBaseBoundariesTestCases( | ||
self::DATE, | ||
self::LOCATION, | ||
self::TAX_CLASS, | ||
self::WAGE_BASE_IN_CENTS, | ||
self::TAX_RATE | ||
); | ||
} | ||
} |