Lines 186-191
Link Here
|
186 |
reformatFileContents("testfiles/formatting/blankLines/Trait01.php", options); |
186 |
reformatFileContents("testfiles/formatting/blankLines/Trait01.php", options); |
187 |
} |
187 |
} |
188 |
|
188 |
|
|
|
189 |
public void testBLAnonymousClass01() throws Exception { |
190 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
191 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
192 |
reformatFileContents("testfiles/formatting/blankLines/AnonymousClass01.php", options); |
193 |
} |
194 |
|
189 |
public void testBLClass02() throws Exception { |
195 |
public void testBLClass02() throws Exception { |
190 |
HashMap<String, Object> options = new HashMap<String, Object>(FmtOptions.getDefaults()); |
196 |
HashMap<String, Object> options = new HashMap<String, Object>(FmtOptions.getDefaults()); |
191 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
197 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
Lines 206-211
Link Here
|
206 |
reformatFileContents("testfiles/formatting/blankLines/Trait02.php", options); |
212 |
reformatFileContents("testfiles/formatting/blankLines/Trait02.php", options); |
207 |
} |
213 |
} |
208 |
|
214 |
|
|
|
215 |
public void testBLAnonymousClass02() throws Exception { |
216 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
217 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
218 |
options.put(FmtOptions.ANONYMOUS_CLASS_BRACE_PLACEMENT, CodeStyle.BracePlacement.PRESERVE_EXISTING); |
219 |
options.put(FmtOptions.METHOD_DECL_BRACE_PLACEMENT, CodeStyle.BracePlacement.PRESERVE_EXISTING); |
220 |
options.put(FmtOptions.OTHER_BRACE_PLACEMENT, CodeStyle.BracePlacement.PRESERVE_EXISTING); |
221 |
options.put(FmtOptions.SPACE_BEFORE_CLASS_DECL_LEFT_BRACE, false); |
222 |
reformatFileContents("testfiles/formatting/blankLines/AnonymousClass02.php", options); |
223 |
} |
224 |
|
209 |
public void testBLClass03() throws Exception { |
225 |
public void testBLClass03() throws Exception { |
210 |
HashMap<String, Object> options = new HashMap<String, Object>(FmtOptions.getDefaults()); |
226 |
HashMap<String, Object> options = new HashMap<String, Object>(FmtOptions.getDefaults()); |
211 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
227 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
Lines 226-231
Link Here
|
226 |
reformatFileContents("testfiles/formatting/blankLines/Trait03.php", options); |
242 |
reformatFileContents("testfiles/formatting/blankLines/Trait03.php", options); |
227 |
} |
243 |
} |
228 |
|
244 |
|
|
|
245 |
public void testBLAnonymousClass03() throws Exception { |
246 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
247 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
248 |
options.put(FmtOptions.ANONYMOUS_CLASS_BRACE_PLACEMENT, CodeStyle.BracePlacement.NEW_LINE); |
249 |
options.put(FmtOptions.METHOD_DECL_BRACE_PLACEMENT, CodeStyle.BracePlacement.NEW_LINE); |
250 |
options.put(FmtOptions.OTHER_BRACE_PLACEMENT, CodeStyle.BracePlacement.SAME_LINE); |
251 |
options.put(FmtOptions.SPACE_BEFORE_CLASS_DECL_LEFT_BRACE, false); |
252 |
reformatFileContents("testfiles/formatting/blankLines/AnonymousClass03.php", options); |
253 |
} |
254 |
|
255 |
|
229 |
public void testBLFields01() throws Exception { |
256 |
public void testBLFields01() throws Exception { |
230 |
HashMap<String, Object> options = new HashMap<String, Object>(FmtOptions.getDefaults()); |
257 |
HashMap<String, Object> options = new HashMap<String, Object>(FmtOptions.getDefaults()); |
231 |
options.put(FmtOptions.SPACE_BEFORE_CLASS_DECL_LEFT_BRACE, true); |
258 |
options.put(FmtOptions.SPACE_BEFORE_CLASS_DECL_LEFT_BRACE, true); |
Lines 744-749
Link Here
|
744 |
reformatFileContents("testfiles/formatting/blankLines/SimpleTrait17.php", options); |
771 |
reformatFileContents("testfiles/formatting/blankLines/SimpleTrait17.php", options); |
745 |
} |
772 |
} |
746 |
|
773 |
|
|
|
774 |
public void testBLSimpleAnonymousClass01() throws Exception { |
775 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
776 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
777 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass01.php", options); |
778 |
} |
779 |
|
780 |
public void testBLSimpleAnonymousClass02() throws Exception { |
781 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
782 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
783 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass02.php", options); |
784 |
} |
785 |
|
786 |
public void testBLSimpleAnonymousClass03() throws Exception { |
787 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
788 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
789 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass03.php", options); |
790 |
} |
791 |
|
792 |
public void testBLSimpleAnonymousClass04() throws Exception { |
793 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
794 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
795 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass04.php", options); |
796 |
} |
797 |
|
798 |
public void testBLSimpleAnonymousClass05() throws Exception { |
799 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
800 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
801 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS, 1); |
802 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS_HEADER, 0); |
803 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS_END, 0); |
804 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS, 0); |
805 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION, 0); |
806 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION_END, 0); |
807 |
options.put(FmtOptions.BLANK_LINES_AFTER_FUNCTION, 0); |
808 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FIELDS, 0); |
809 |
options.put(FmtOptions.BLANK_LINES_AFTER_FIELDS, 0); |
810 |
options.put(FmtOptions.BLANK_LINES_BEFORE_NAMESPACE, 0); |
811 |
options.put(FmtOptions.BLANK_LINES_AFTER_NAMESPACE, 0); |
812 |
options.put(FmtOptions.BLANK_LINES_BEFORE_USE, 0); |
813 |
options.put(FmtOptions.BLANK_LINES_AFTER_USE, 0); |
814 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass05.php", options); |
815 |
} |
816 |
|
817 |
public void testBLSimpleAnonymousClass06() throws Exception { |
818 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
819 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
820 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS, 0); |
821 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS_HEADER, 1); |
822 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS_END, 0); |
823 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS, 0); |
824 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION, 0); |
825 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION_END, 0); |
826 |
options.put(FmtOptions.BLANK_LINES_AFTER_FUNCTION, 0); |
827 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FIELDS, 0); |
828 |
options.put(FmtOptions.BLANK_LINES_AFTER_FIELDS, 0); |
829 |
options.put(FmtOptions.BLANK_LINES_BEFORE_NAMESPACE, 0); |
830 |
options.put(FmtOptions.BLANK_LINES_AFTER_NAMESPACE, 0); |
831 |
options.put(FmtOptions.BLANK_LINES_BEFORE_USE, 0); |
832 |
options.put(FmtOptions.BLANK_LINES_AFTER_USE, 0); |
833 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass06.php", options); |
834 |
} |
835 |
|
836 |
public void testBLSimpleAnonymousClass07() throws Exception { |
837 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
838 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
839 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS, 0); |
840 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS_HEADER, 0); |
841 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS_END, 1); |
842 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS, 0); |
843 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION, 0); |
844 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION_END, 0); |
845 |
options.put(FmtOptions.BLANK_LINES_AFTER_FUNCTION, 0); |
846 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FIELDS, 0); |
847 |
options.put(FmtOptions.BLANK_LINES_AFTER_FIELDS, 0); |
848 |
options.put(FmtOptions.BLANK_LINES_BEFORE_NAMESPACE, 0); |
849 |
options.put(FmtOptions.BLANK_LINES_AFTER_NAMESPACE, 0); |
850 |
options.put(FmtOptions.BLANK_LINES_BEFORE_USE, 0); |
851 |
options.put(FmtOptions.BLANK_LINES_AFTER_USE, 0); |
852 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass07.php", options); |
853 |
} |
854 |
|
855 |
public void testBLSimpleAnonymousClass08() throws Exception { |
856 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
857 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
858 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS, 0); |
859 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS_HEADER, 0); |
860 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS_END, 0); |
861 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS, 1); // ignore |
862 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION, 0); |
863 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION_END, 0); |
864 |
options.put(FmtOptions.BLANK_LINES_AFTER_FUNCTION, 0); |
865 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FIELDS, 0); |
866 |
options.put(FmtOptions.BLANK_LINES_AFTER_FIELDS, 0); |
867 |
options.put(FmtOptions.BLANK_LINES_BEFORE_NAMESPACE, 0); |
868 |
options.put(FmtOptions.BLANK_LINES_AFTER_NAMESPACE, 0); |
869 |
options.put(FmtOptions.BLANK_LINES_BEFORE_USE, 0); |
870 |
options.put(FmtOptions.BLANK_LINES_AFTER_USE, 0); |
871 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass08.php", options); |
872 |
} |
873 |
|
874 |
public void testBLSimpleAnonymousClass09() throws Exception { |
875 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
876 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
877 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS, 0); |
878 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS_HEADER, 0); |
879 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS_END, 0); |
880 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS, 0); |
881 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION, 1); |
882 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION_END, 0); |
883 |
options.put(FmtOptions.BLANK_LINES_AFTER_FUNCTION, 0); |
884 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FIELDS, 0); |
885 |
options.put(FmtOptions.BLANK_LINES_AFTER_FIELDS, 0); |
886 |
options.put(FmtOptions.BLANK_LINES_BEFORE_NAMESPACE, 0); |
887 |
options.put(FmtOptions.BLANK_LINES_AFTER_NAMESPACE, 0); |
888 |
options.put(FmtOptions.BLANK_LINES_BEFORE_USE, 0); |
889 |
options.put(FmtOptions.BLANK_LINES_AFTER_USE, 0); |
890 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass09.php", options); |
891 |
} |
892 |
|
893 |
public void testBLSimpleAnonymousClass10() throws Exception { |
894 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
895 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
896 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS, 0); |
897 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS_HEADER, 0); |
898 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS_END, 0); |
899 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS, 0); |
900 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION, 0); |
901 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION_END, 1); |
902 |
options.put(FmtOptions.BLANK_LINES_AFTER_FUNCTION, 0); |
903 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FIELDS, 0); |
904 |
options.put(FmtOptions.BLANK_LINES_AFTER_FIELDS, 0); |
905 |
options.put(FmtOptions.BLANK_LINES_BEFORE_NAMESPACE, 0); |
906 |
options.put(FmtOptions.BLANK_LINES_AFTER_NAMESPACE, 0); |
907 |
options.put(FmtOptions.BLANK_LINES_BEFORE_USE, 0); |
908 |
options.put(FmtOptions.BLANK_LINES_AFTER_USE, 0); |
909 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass10.php", options); |
910 |
} |
911 |
|
912 |
public void testBLSimpleAnonymousClass11() throws Exception { |
913 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
914 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
915 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS, 0); |
916 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS_HEADER, 0); |
917 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS_END, 0); |
918 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS, 0); |
919 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION, 0); |
920 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION_END, 0); |
921 |
options.put(FmtOptions.BLANK_LINES_AFTER_FUNCTION, 1); // before class end is used |
922 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FIELDS, 0); |
923 |
options.put(FmtOptions.BLANK_LINES_AFTER_FIELDS, 0); |
924 |
options.put(FmtOptions.BLANK_LINES_BEFORE_NAMESPACE, 0); |
925 |
options.put(FmtOptions.BLANK_LINES_AFTER_NAMESPACE, 0); |
926 |
options.put(FmtOptions.BLANK_LINES_BEFORE_USE, 0); |
927 |
options.put(FmtOptions.BLANK_LINES_AFTER_USE, 0); |
928 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass11.php", options); |
929 |
} |
930 |
|
931 |
public void testBLSimpleAnonymousClass12() throws Exception { |
932 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
933 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
934 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS, 0); |
935 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS_HEADER, 1); |
936 |
options.put(FmtOptions.BLANK_LINES_BEFORE_CLASS_END, 1); |
937 |
options.put(FmtOptions.BLANK_LINES_AFTER_CLASS, 0); |
938 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION, 1); |
939 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FUNCTION_END, 1); |
940 |
options.put(FmtOptions.BLANK_LINES_AFTER_FUNCTION, 1); |
941 |
options.put(FmtOptions.BLANK_LINES_BEFORE_FIELDS, 0); |
942 |
options.put(FmtOptions.BLANK_LINES_AFTER_FIELDS, 0); |
943 |
options.put(FmtOptions.BLANK_LINES_BEFORE_NAMESPACE, 0); |
944 |
options.put(FmtOptions.BLANK_LINES_AFTER_NAMESPACE, 0); |
945 |
options.put(FmtOptions.BLANK_LINES_BEFORE_USE, 0); |
946 |
options.put(FmtOptions.BLANK_LINES_AFTER_USE, 0); |
947 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass12.php", options); |
948 |
} |
949 |
|
950 |
public void testBLSimpleAnonymousClass13() throws Exception { |
951 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
952 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass13.php", options); |
953 |
} |
954 |
|
955 |
public void testBLSimpleAnonymousClass14() throws Exception { |
956 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
957 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass14.php", options); |
958 |
} |
959 |
|
960 |
public void testBLSimpleAnonymousClass15() throws Exception { |
961 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
962 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass15.php", options); |
963 |
} |
964 |
|
965 |
public void testBLSimpleAnonymousClass16() throws Exception { |
966 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
967 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
968 |
options.put(FmtOptions.ANONYMOUS_CLASS_BRACE_PLACEMENT, CodeStyle.BracePlacement.NEW_LINE_INDENTED); |
969 |
options.put(FmtOptions.METHOD_DECL_BRACE_PLACEMENT, CodeStyle.BracePlacement.NEW_LINE_INDENTED); |
970 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass16.php", options); |
971 |
} |
972 |
|
973 |
public void testBLSimpleAnonymousClass17() throws Exception { |
974 |
HashMap<String, Object> options = new HashMap<>(FmtOptions.getDefaults()); |
975 |
options.put(FmtOptions.INITIAL_INDENT, 4); |
976 |
options.put(FmtOptions.ANONYMOUS_CLASS_BRACE_PLACEMENT, CodeStyle.BracePlacement.NEW_LINE_INDENTED); |
977 |
options.put(FmtOptions.METHOD_DECL_BRACE_PLACEMENT, CodeStyle.BracePlacement.NEW_LINE_INDENTED); |
978 |
reformatFileContents("testfiles/formatting/blankLines/SimpleAnonymousClass17.php", options); |
979 |
} |
980 |
|
747 |
public void testBLSimpleUse01() throws Exception { |
981 |
public void testBLSimpleUse01() throws Exception { |
748 |
HashMap<String, Object> options = new HashMap<String, Object>(FmtOptions.getDefaults()); |
982 |
HashMap<String, Object> options = new HashMap<String, Object>(FmtOptions.getDefaults()); |
749 |
options.put(FmtOptions.INITIAL_INDENT, 0); |
983 |
options.put(FmtOptions.INITIAL_INDENT, 0); |