Skip to content

Commit

Permalink
l10 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
roblesterjr04 committed Apr 13, 2023
1 parent 7ef856b commit 73aa7bc
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 16 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"require": {
"php": "^7.0 || ^8.0 || ^8.1",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"laravel/framework": "^6.0 || ^7.0 || ^8.40.0 || ^9.0 || ^10.0.3",
"laravel/framework": "^6.0 || ^7.0 || ^8.40.0 || ^9.0 || ^10.0",
"omniphx/forrest": "^2.0"
},
"require-dev": {
"laravel/dusk": "^6.19",
"orchestra/testbench": ">=3.5",
"laravel/dusk": "^6.19 || ^7.0",
"orchestra/testbench": "^3.8 || ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
"phpunit/phpunit": ">=6.0 || >=10.0"
},
"autoload": {
Expand Down
17 changes: 6 additions & 11 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
convertWarningsToExceptions="false"
cacheResult="false"
colors="true">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" bootstrap="vendor/autoload.php" cacheResult="false" colors="true" cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="Package">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<php>
<env name="LOGIN_URL" value="https://login.salesforce.com"/>
<env name="CACHE_DRIVER" value="file" />
<env name="APP_KEY" value="base64:WRAf0EDpFqwpbS829xKy2MGEkcJxIEmMrwFIZbGxIqE=" />
<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>
<env name="LOGIN_URL" value="https://login.salesforce.com"/>
<env name="CACHE_DRIVER" value="file"/>
<env name="APP_KEY" value="base64:WRAf0EDpFqwpbS829xKy2MGEkcJxIEmMrwFIZbGxIqE="/>
<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>
</php>
</phpunit>
20 changes: 20 additions & 0 deletions phpunit.xml.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
convertWarningsToExceptions="false"
cacheResult="false"
colors="true">
<testsuites>
<testsuite name="Package">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<php>
<env name="LOGIN_URL" value="https://login.salesforce.com"/>
<env name="CACHE_DRIVER" value="file" />
<env name="APP_KEY" value="base64:WRAf0EDpFqwpbS829xKy2MGEkcJxIEmMrwFIZbGxIqE=" />
<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>
</php>
</phpunit>
7 changes: 5 additions & 2 deletions tests/EloquentSalesForceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,14 @@ public function testWhereDate()
'Custom_Date_Field__c' => $now,
'Company' => 'Test Co',
]);
$lead = TestLead::select('Custom_Date_Field__c', 'Id')->where('Email', '[email protected]')->whereDate('Custom_Date_Field__c', '>=', today())->first();
$lead = TestLead::select('Custom_Date_Field__c', 'Id')
->where('Email', '[email protected]')
->whereDate('Custom_Date_Field__c', '>=', today())
->first();

TestLead::whereTime('CreatedDate', now())->get();

$this->assertEquals($now->startOfDay(), $lead->Custom_Date_Field__c);
$this->assertTrue($now->startOfDay()->eq($lead->Custom_Date_Field__c));
}

public function testOrWhere()
Expand Down

0 comments on commit 73aa7bc

Please sign in to comment.