You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit df4b7c6
Browse filesBrowse the repository at this point in the historyBrowse files
$table = new \CodeIgniter\View\Table($table_template);
861
+
$table->setHeading([
862
+
'codigo' => 'Codigo Orçamento',
863
+
'data' => 'Data do Orçamento',
864
+
'tipo_desconto' => 'Tipo de Desconto',
865
+
'valor_desconto' => 'Valor do Desconto',
866
+
])->setSyncRowsWithHeading(true);
867
+
868
+
$sampleData = [
869
+
[
870
+
'id' => 1,
871
+
'id_cliente' => 1,
872
+
'codigo' => 'codigo1',
873
+
'data' => '2023-10-16 21:53:25',
874
+
'tipo_desconto' => 'NENHUM',
875
+
'valor_desconto' => '',
876
+
'created_at' => '2023-10-16 21:53:25',
877
+
'updated_at' => '2023-10-16 21:53:25',
878
+
'deleted_at' => '',
879
+
],
880
+
[
881
+
'id' => 2,
882
+
'id_cliente' => 2,
883
+
'codigo' => 'codigo2',
884
+
'data' => '2023-10-16 21:53:25',
885
+
'tipo_desconto' => 'REAL',
886
+
'valor_desconto' => 10.00,
887
+
'created_at' => '2023-10-16 21:53:25',
888
+
'updated_at' => '2023-10-16 21:53:25',
889
+
'deleted_at' => '',
890
+
],
891
+
[
892
+
'id' => 3,
893
+
'id_cliente' => 3,
894
+
'codigo' => 'codigo3',
895
+
'data' => '2023-10-16 21:53:25',
896
+
'tipo_desconto' => 'PERCENTUAL',
897
+
'valor_desconto' => 10.00,
898
+
'created_at' => '2023-10-16 21:53:25',
899
+
'updated_at' => '2023-10-16 21:53:25',
900
+
'deleted_at' => '',
901
+
],
902
+
];
903
+
904
+
$generated = $table->generate($sampleData);
905
+
906
+
$this->assertStringContainsString('<th>Codigo Orçamento</th><th>Data do Orçamento</th><th>Tipo de Desconto</th><th>Valor do Desconto</th>', $generated);
0 commit comments