Skip to content

Commit f26bc74

Browse files
committed
Code style
1 parent 3aacbb6 commit f26bc74

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

Tests/Unit/MiscellaneousTest.php

+18-18
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,6 @@ enum TestEnum : int
1010

1111
class MiscellaneousTest extends \PHPUnit\Framework\TestCase
1212
{
13-
public function testNullAssignment() : void
14-
{
15-
$po = new \Tests\App\Record\PurchaseOrder();
16-
$po->payment_method = 'Cash';
17-
$this->assertNotNull($po->payment_method);
18-
$po->payment_method = null;
19-
$this->assertNull($po->payment_method);
20-
}
21-
22-
public function testNullAssignmentError() : void
23-
{
24-
$po = new \Tests\App\Record\PurchaseOrder();
25-
$this->assertIsFloat($po->shipping_fee);
26-
$this->assertEquals(0.0, $po->shipping_fee);
27-
$this->expectException(\PHPFUI\ORM\Exception::class);
28-
$po->shipping_fee = null;
29-
}
30-
3113
public function testEnumCondition() : void
3214
{
3315
$condition = new \PHPFUI\ORM\Condition('field', TestEnum::YES);
@@ -69,6 +51,24 @@ public function testLiteralCondition() : void
6951
$this->assertEquals('field = invoiceItem.storeItemId', (string)$condition);
7052
}
7153

54+
public function testNullAssignment() : void
55+
{
56+
$po = new \Tests\App\Record\PurchaseOrder();
57+
$po->payment_method = 'Cash';
58+
$this->assertNotNull($po->payment_method);
59+
$po->payment_method = null;
60+
$this->assertNull($po->payment_method);
61+
}
62+
63+
public function testNullAssignmentError() : void
64+
{
65+
$po = new \Tests\App\Record\PurchaseOrder();
66+
$this->assertIsFloat($po->shipping_fee);
67+
$this->assertEquals(0.0, $po->shipping_fee);
68+
$this->expectException(\PHPFUI\ORM\Exception::class);
69+
$po->shipping_fee = null;
70+
}
71+
7272
public function testRow() : void
7373
{
7474
$row = \PHPFUI\ORM::getRow('select * from customer');

src/PHPFUI/ORM/Tool/Generate/CRUD.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ protected function getLine(\PHPFUI\ORM\Schema\Field $field) : string
179179
case 'float':
180180
if (null !== $field->defaultValue)
181181
{
182-
$temp = str_replace("'", '', $field->defaultValue);
182+
$temp = \str_replace("'", '', $field->defaultValue);
183183
$defaultValue = 'NULL' !== $field->defaultValue ? $temp : 'NULL';
184184
}
185185

0 commit comments

Comments
 (0)