From 248cdf495001c61f0a8bda3463c12254e4185070 Mon Sep 17 00:00:00 2001 From: Andrew Waters Date: Mon, 14 Dec 2015 10:01:27 +0000 Subject: [PATCH 1/2] Adds encrypted field type to Flows --- src/Flows.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Flows.php b/src/Flows.php index 6ad0f49..a30a388 100755 --- a/src/Flows.php +++ b/src/Flows.php @@ -210,6 +210,13 @@ protected function typeText($a) return ''; } + protected function typeEncrypted($a) + { + $this->args['type'] = 'password'; + + return '_buildArgs($this->args) . ' />'; + } + protected function _buildArgs($args, $skipValue = false) { $string = ''; From ae3abf19feb27c03e31abc3ca3e352241c8db4d4 Mon Sep 17 00:00:00 2001 From: Andrew Waters Date: Mon, 14 Dec 2015 10:17:47 +0000 Subject: [PATCH 2/2] Adds test for encrypted field type --- tests/FlowsTest.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/FlowsTest.php b/tests/FlowsTest.php index f0358d2..9f88bea 100644 --- a/tests/FlowsTest.php +++ b/tests/FlowsTest.php @@ -69,6 +69,27 @@ public function test_email_type() $this->assertEquals('', $flow['input']); } + public function test_encrypted_type() + { + $field = array( + 'name' => 'Password', + 'slug' => 'password', + 'type' => 'encrypted', + 'options' => array(), + 'required' => false, + ); + + $flow = $this->newBuiltFlowTypeFromField($field); + + $this->assertEquals($field['name'], $flow['name']); + $this->assertEquals($field['slug'], $flow['slug']); + $this->assertEquals($field['type'], $flow['type']); + $this->assertEquals($field['options'], $flow['options']); + $this->assertEquals($field['required'], $flow['required']); + + $this->assertEquals('', $flow['input']); + } + public function test_slug_type() { $field = array(